explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MWOh

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 1,342.598 ↑ 1.0 1 1

Aggregate (cost=873,641.71..873,641.72 rows=1 width=8) (actual time=1,342.598..1,342.598 rows=1 loops=1)

  • Functions: 60
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 4.905 ms, Inlining 21.958 ms, Optimization 251.378 ms, Emission 151.006 ms, Total 429.246 ms
2. 0.001 1,342.585 ↓ 0.0 0 1

Unique (cost=873,531.20..873,562.77 rows=6,315 width=16) (actual time=1,342.585..1,342.585 rows=0 loops=1)

3. 0.013 1,342.584 ↓ 0.0 0 1

Sort (cost=873,531.20..873,546.98 rows=6,315 width=16) (actual time=1,342.584..1,342.584 rows=0 loops=1)

  • Sort Key: api_upload.system_uuid
  • Sort Method: quicksort Memory: 25kB
4. 286.760 1,342.571 ↓ 0.0 0 1

Hash Join (cost=54,071.30..873,132.57 rows=6,315 width=16) (actual time=1,342.571..1,342.571 rows=0 loops=1)

  • Hash Cond: (api_report.upload_id = api_upload.id)
5. 139.468 929.979 ↑ 2.3 1,145,295 1

Nested Loop (cost=31.58..790,706.08 rows=2,660,865 width=4) (actual time=425.709..929.979 rows=1,145,295 loops=1)

6. 0.057 387.293 ↓ 6.8 81 1

Nested Loop (cost=11.07..125.05 rows=12 width=8) (actual time=386.858..387.293 rows=81 loops=1)

7. 0.028 386.908 ↓ 6.3 82 1

Nested Loop (cost=10.79..31.76 rows=13 width=4) (actual time=386.838..386.908 rows=82 loops=1)

8. 0.005 386.811 ↑ 1.0 1 1

HashAggregate (cost=7.01..7.02 rows=1 width=8) (actual time=386.811..386.811 rows=1 loops=1)

  • Group Key: u0.id
9. 0.045 386.806 ↑ 1.0 1 1

Hash Join (cost=1.09..7.01 rows=1 width=8) (actual time=386.786..386.806 rows=1 loops=1)

  • Hash Cond: (u0.id = u1.tag_id)
10. 0.040 0.040 ↑ 1.0 310 1

Seq Scan on api_tag u0 (cost=0.00..5.10 rows=310 width=4) (actual time=0.013..0.040 rows=310 loops=1)

11. 0.004 386.721 ↑ 1.0 1 1

Hash (cost=1.07..1.07 rows=1 width=4) (actual time=386.721..386.721 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 386.717 386.717 ↑ 1.0 1 1

Seq Scan on api_ruletopic_tags u1 (cost=0.00..1.07 rows=1 width=4) (actual time=386.715..386.717 rows=1 loops=1)

  • Filter: (ruletopic_id = 4)
  • Rows Removed by Filter: 5
13. 0.057 0.069 ↓ 6.3 82 1

Bitmap Heap Scan on api_rule_tags (cost=3.77..24.60 rows=13 width=8) (actual time=0.019..0.069 rows=82 loops=1)

  • Recheck Cond: (tag_id = u0.id)
  • Heap Blocks: exact=5
14. 0.012 0.012 ↓ 6.3 82 1

Bitmap Index Scan on api_rule_tags_tag_id_72c43fbe (cost=0.00..3.77 rows=13 width=0) (actual time=0.012..0.012 rows=82 loops=1)

  • Index Cond: (tag_id = u0.id)
15. 0.328 0.328 ↑ 1.0 1 82

Index Scan using api_rule_pkey on api_rule (cost=0.28..7.18 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=82)

  • Index Cond: (id = api_rule_tags.rule_id)
  • Filter: active
  • Rows Removed by Filter: 0
16. 364.939 403.218 ↑ 60.3 14,139 81

Index Only Scan using api_report_rule_id_1892e1_idx on api_report (cost=20.51..57,355.14 rows=852,661 width=8) (actual time=0.544..4.978 rows=14,139 loops=81)

  • Index Cond: (rule_id = api_rule.id)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 217
  • Heap Fetches: 0
17.          

SubPlan (forIndex Only Scan)

18. 38.279 38.279 ↑ 1.0 355 1

Seq Scan on api_ack (cost=0.00..19.05 rows=355 width=4) (actual time=38.137..38.279 rows=355 loops=1)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 529
19. 14.267 125.832 ↑ 2.2 46,990 1

Hash (cost=52,123.53..52,123.53 rows=104,336 width=20) (actual time=125.832..125.832 rows=46,990 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 1712kB
20. 111.565 111.565 ↑ 2.2 46,990 1

Index Only Scan using api_upload_current_b88a82_idx on api_upload (cost=0.56..52,123.53 rows=104,336 width=20) (actual time=1.950..111.565 rows=46,990 loops=1)

  • Index Cond: ((current = true) AND (account = '729650'::text))
  • Heap Fetches: 0
Planning time : 2.400 ms
Execution time : 1,347.253 ms