explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w6AL

Settings
# exclusive inclusive rows x rows loops node
1. 0.053 64.438 ↑ 1.0 1 1

Aggregate (cost=606.09..606.10 rows=1 width=8) (actual time=64.438..64.438 rows=1 loops=1)

2. 0.408 64.385 ↓ 11.4 502 1

GroupAggregate (cost=524.00..605.54 rows=44 width=12) (actual time=46.968..64.385 rows=502 loops=1)

  • Group Key: tc.id
3. 0.999 63.977 ↓ 52.8 2,322 1

Nested Loop Left Join (cost=524.00..604.88 rows=44 width=4) (actual time=46.938..63.977 rows=2,322 loops=1)

4. 0.157 56.012 ↓ 52.8 2,322 1

Nested Loop (cost=523.58..570.14 rows=44 width=8) (actual time=46.930..56.012 rows=2,322 loops=1)

5. 0.364 49.329 ↓ 23.9 502 1

Nested Loop (cost=523.15..553.54 rows=21 width=8) (actual time=46.915..49.329 rows=502 loops=1)

6. 0.554 47.961 ↓ 23.9 502 1

GroupAggregate (cost=522.73..523.15 rows=21 width=210) (actual time=46.892..47.961 rows=502 loops=1)

  • Group Key: tc_1.id
7. 2.016 47.407 ↓ 150.0 6,150 1

Sort (cost=522.73..522.83 rows=41 width=4) (actual time=46.887..47.407 rows=6,150 loops=1)

  • Sort Key: tc_1.id
  • Sort Method: quicksort Memory: 481kB
8. 4.137 45.391 ↓ 150.0 6,150 1

Nested Loop (cost=257.06..521.63 rows=41 width=4) (actual time=4.611..45.391 rows=6,150 loops=1)

9. 1.239 15.871 ↓ 74.9 8,461 1

Nested Loop (cost=256.63..444.68 rows=113 width=8) (actual time=4.581..15.871 rows=8,461 loops=1)

10. 1.167 5.578 ↓ 24.0 503 1

Bitmap Heap Scan on tickets tc_1 (cost=256.20..320.94 rows=21 width=4) (actual time=4.518..5.578 rows=503 loops=1)

  • Recheck Cond: ((owner = 510674) AND (queue = 4) AND ((status)::text = 'resolved'::text))
  • Filter: (timezone('Europe/Oslo'::text, timezone('UTC'::text, resolved)) <= now())
  • Heap Blocks: exact=361
11. 0.044 4.411 ↓ 0.0 0 1

BitmapAnd (cost=256.20..256.20 rows=63 width=0) (actual time=4.411..4.411 rows=0 loops=1)

12. 0.163 0.163 ↓ 1.1 559 1

Bitmap Index Scan on tickets2 (cost=0.00..6.16 rows=499 width=0) (actual time=0.163..0.163 rows=559 loops=1)

  • Index Cond: (owner = 510674)
13. 4.204 4.204 ↓ 1.3 22,602 1

Bitmap Index Scan on tickets1 (cost=0.00..249.78 rows=17,536 width=0) (actual time=4.204..4.204 rows=22,602 loops=1)

  • Index Cond: ((queue = 4) AND ((status)::text = 'resolved'::text))
14. 9.054 9.054 ↓ 3.4 17 503

Index Scan using transactions1 on transactions tx_1 (cost=0.43..5.84 rows=5 width=8) (actual time=0.009..0.018 rows=17 loops=503)

  • Index Cond: (((objecttype)::text = 'RT::Ticket'::text) AND (objectid = tc_1.id))
15. 25.383 25.383 ↑ 3.0 1 8,461

Index Scan using attachments2 on attachments a (cost=0.42..0.65 rows=3 width=4) (actual time=0.003..0.003 rows=1 loops=8,461)

  • Index Cond: (transactionid = tx_1.id)
  • Filter: ((contenttype)::text = 'text/plain'::text)
  • Rows Removed by Filter: 0
16. 1.004 1.004 ↑ 1.0 1 502

Index Only Scan using tickets_pkey on tickets tc (cost=0.42..1.44 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=502)

  • Index Cond: (id = tc_1.id)
  • Heap Fetches: 306
17. 6.526 6.526 ↓ 1.7 5 502

Index Scan using transactions1 on transactions tx (cost=0.43..0.76 rows=3 width=8) (actual time=0.005..0.013 rows=5 loops=502)

  • Index Cond: (((objecttype)::text = 'RT::Ticket'::text) AND (objectid = tc.id))
  • Filter: ((type)::text = ANY ('{Correspond,Comment,Create}'::text[]))
  • Rows Removed by Filter: 12
18. 6.966 6.966 ↑ 1.0 1 2,322

Index Scan using attachments2 on attachments (cost=0.42..0.78 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=2,322)

  • Index Cond: (transactionid = tx.id)
  • Filter: (((contenttype)::text = 'text/plain'::text) AND ((contentencoding)::text = 'quoted-printable'::text))
  • Rows Removed by Filter: 1
Planning time : 2.324 ms
Execution time : 64.582 ms