explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AhnD

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 190.743 ↑ 1.0 1 1

Aggregate (cost=3,335,556.93..3,335,556.94 rows=1 width=8) (actual time=190.743..190.743 rows=1 loops=1)

2. 0.001 190.739 ↓ 0.0 0 1

Unique (cost=3,334,785.32..3,335,005.78 rows=44,092 width=16) (actual time=190.739..190.739 rows=0 loops=1)

3. 0.000 190.738 ↓ 0.0 0 1

Sort (cost=3,334,785.32..3,334,895.55 rows=44,092 width=16) (actual time=190.738..190.738 rows=0 loops=1)

  • Sort Key: api_upload.system_uuid
  • Sort Method: quicksort Memory: 25kB
4. 6.901 190.850 ↓ 0.0 0 1

Gather (cost=1,443.83..3,331,384.01 rows=44,092 width=16) (actual time=190.729..190.850 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 11.910 183.949 ↓ 0.0 0 3

Hash Join (cost=443.83..3,325,974.81 rows=18,372 width=16) (actual time=183.948..183.949 rows=0 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
6. 99.113 169.810 ↑ 2.6 69,060 3

Nested Loop (cost=20.51..3,324,682.88 rows=180,842 width=20) (actual time=2.152..169.810 rows=69,060 loops=3)

7. 70.686 70.686 ↑ 4.0 7,455 3

Parallel Index Only Scan using api_upload_current_b88a82_idx on api_upload (cost=0.56..35,688.47 rows=30,132 width=20) (actual time=1.872..70.686 rows=7,455 loops=3)

  • Index Cond: ((current = true) AND (account = '729650'::text))
  • Filter: current
  • Heap Fetches: 2798
8. 0.000 0.011 ↑ 111.2 9 22,364

Index Only Scan using api_report_upload_rule_id_idx on api_report (cost=19.95..99.14 rows=1,001 width=8) (actual time=0.005..0.011 rows=9 loops=22,364)

  • Index Cond: (upload_id = api_upload.id)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 1
  • Heap Fetches: 13489
9.          

SubPlan (forIndex Only Scan)

10. 0.161 0.161 ↑ 1.0 355 3

Seq Scan on api_ack (cost=0.00..18.49 rows=355 width=4) (actual time=0.012..0.161 rows=355 loops=3)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 531
11. 0.021 2.229 ↑ 1.4 81 3

Hash (cost=421.86..421.86 rows=117 width=8) (actual time=2.229..2.229 rows=81 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
12. 0.131 2.208 ↑ 1.4 81 3

Hash Join (cost=96.84..421.86 rows=117 width=8) (actual time=1.535..2.208 rows=81 loops=3)

  • Hash Cond: (api_rule.id = api_rule_tags.rule_id)
13. 0.592 0.592 ↓ 1.0 999 3

Seq Scan on api_rule (cost=0.00..320.11 rows=997 width=4) (actual time=0.008..0.592 rows=999 loops=3)

  • Filter: active
  • Rows Removed by Filter: 112
14. 0.020 1.485 ↑ 1.6 82 3

Hash (cost=95.21..95.21 rows=130 width=4) (actual time=1.484..1.485 rows=82 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
15. 0.945 1.465 ↑ 1.6 82 3

Hash Semi Join (cost=21.01..95.21 rows=130 width=4) (actual time=1.090..1.465 rows=82 loops=3)

  • Hash Cond: (api_rule_tags.tag_id = u0.id)
16. 0.414 0.414 ↑ 1.0 3,941 3

Seq Scan on api_rule_tags (cost=0.00..62.41 rows=3,941 width=8) (actual time=0.010..0.414 rows=3,941 loops=3)

17. 0.003 0.106 ↑ 10.0 1 3

Hash (cost=20.89..20.89 rows=10 width=8) (actual time=0.106..0.106 rows=1 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.048 0.103 ↑ 10.0 1 3

Hash Join (cost=14.91..20.89 rows=10 width=8) (actual time=0.087..0.103 rows=1 loops=3)

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

Seq Scan on api_tag u0 (cost=0.00..5.14 rows=314 width=4) (actual time=0.009..0.040 rows=310 loops=3)

20. 0.006 0.015 ↑ 10.0 1 3

Hash (cost=14.79..14.79 rows=10 width=4) (actual time=0.015..0.015 rows=1 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.009 0.009 ↑ 10.0 1 3

Bitmap Heap Scan on api_ruletopic_tags u1 (cost=4.23..14.79 rows=10 width=4) (actual time=0.008..0.009 rows=1 loops=3)

  • Recheck Cond: (ruletopic_id = 4)
  • Heap Blocks: exact=1
  • -> Bitmap Index Scan on api_ruletopic_tags_ruletopic_id_720132f3 (cost=0.00..4.23 rows=10 width=0) (actual time=0.005..0.005 rows=1 lo
  • Index Cond: (ruletopic_id = 4)
Planning time : 1.600 ms
Execution time : 191.000 ms