explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1WfL

Settings
# exclusive inclusive rows x rows loops node
1. 46.367 16,748.757 ↑ 5.2 66 1

GroupAggregate (cost=2,313,925.71..2,315,371.24 rows=340 width=12) (actual time=16,687.205..16,748.757 rows=66 loops=1)

  • Group Key: api_rule.id
2. 118.464 16,702.390 ↑ 1.3 149,134 1

Sort (cost=2,313,925.71..2,314,406.42 rows=192,285 width=20) (actual time=16,687.175..16,702.390 rows=149,134 loops=1)

  • Sort Key: api_rule.id
  • Sort Method: external merge Disk: 4384kB
3. 0.000 16,583.926 ↑ 1.3 149,134 1

Gather (cost=1,260.47..2,293,105.42 rows=192,285 width=20) (actual time=321.351..16,583.926 rows=149,134 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 23.755 16,606.023 ↑ 1.6 49,711 3

Hash Join (cost=260.48..2,272,876.92 rows=80,119 width=20) (actual time=294.318..16,606.023 rows=49,711 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
5. 87.585 16,581.516 ↑ 2.3 96,461 3

Nested Loop (cost=0.57..2,272,042.84 rows=217,735 width=20) (actual time=293.533..16,581.516 rows=96,461 loops=3)

6. 16,493.921 16,493.921 ↑ 3.0 6,881 3

Parallel Seq Scan on api_upload (cost=0.00..632,512.98 rows=20,823 width=20) (actual time=293.486..16,493.921 rows=6,881 loops=3)

  • Filter: (current AND ((account)::text = '729650'::text))
  • Rows Removed by Filter: 3995739
7. 0.010 0.010 ↑ 98.2 14 20,643

Index Only Scan using api_report_upload_id_rule_id_1a55a613_uniq on api_report (cost=0.57..64.99 rows=1,375 width=8) (actual time=0.005..0.010 rows=14 loops=20,643)

  • Index Cond: (upload_id = api_upload.id)
  • Heap Fetches: 67277
8. 0.054 0.752 ↓ 1.1 357 3

Hash (cost=255.66..255.66 rows=340 width=4) (actual time=0.752..0.752 rows=357 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
9. 0.585 0.698 ↓ 1.1 357 3

Seq Scan on api_rule (cost=17.11..255.66 rows=340 width=4) (actual time=0.194..0.698 rows=357 loops=3)

  • Filter: (active AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 581
10.          

SubPlan (forSeq Scan)

11. 0.113 0.113 ↑ 1.0 353 3

Seq Scan on api_ack (cost=0.00..16.23 rows=353 width=4) (actual time=0.020..0.113 rows=353 loops=3)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 386