explain.depesz.com

PostgreSQL's explain analyze made readable

Result: i71k

Settings
# exclusive inclusive rows x rows loops node
1. 56.125 1,224.480 ↑ 5.2 66 1

GroupAggregate (cost=484,444.04..488,668.06 rows=340 width=12) (actual time=1,148.086..1,224.480 rows=66 loops=1)

  • Group Key: api_rule.id
2. 89.388 1,168.355 ↑ 3.8 149,263 1

Sort (cost=484,444.04..485,850.92 rows=562,749 width=20) (actual time=1,148.068..1,168.355 rows=149,263 loops=1)

  • Sort Key: api_rule.id
  • Sort Method: external merge Disk: 4392kB
3. 3.585 1,078.967 ↑ 3.8 149,263 1

Gather (cost=37,034.32..419,152.52 rows=562,749 width=20) (actual time=144.410..1,078.967 rows=149,263 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 19.999 1,075.382 ↑ 4.7 49,754 3

Hash Join (cost=36,034.32..361,877.62 rows=234,479 width=20) (actual time=145.229..1,075.382 rows=49,754 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
5. 310.288 1,054.122 ↑ 6.6 96,486 3

Merge Join (cost=35,854.41..360,017.30 rows=637,230 width=20) (actual time=143.919..1,054.122 rows=96,486 loops=3)

  • Merge Cond: (api_report.upload_id = api_upload.id)
6. 598.190 598.190 ↑ 1.3 4,654,837 3

Parallel Index Only Scan using api_report_upload_id_rule_id_1a55a613_uniq on api_report (cost=0.43..301,697.87 rows=6,252,974 width=8) (actual time=0.056..598.190 rows=4,654,837 loops=3)

  • Heap Fetches: 0
7. 8.754 145.644 ↑ 5.3 20,634 3

Sort (cost=35,768.06..36,041.39 rows=109,331 width=20) (actual time=143.432..145.644 rows=20,634 loops=3)

  • Sort Key: api_upload.id
  • Sort Method: quicksort Memory: 2381kB
8. 136.890 136.890 ↑ 5.3 20,634 3

Seq Scan on api_upload (cost=0.00..24,374.46 rows=109,331 width=20) (actual time=0.142..136.890 rows=20,634 loops=3)

  • Filter: (current AND ((account)::text = '729650'::text))
  • Rows Removed by Filter: 1052203
9. 0.104 1.261 ↑ 1.0 337 3

Hash (cost=175.66..175.66 rows=340 width=4) (actual time=1.261..1.261 rows=337 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
10. 0.957 1.157 ↑ 1.0 337 3

Seq Scan on api_rule (cost=17.11..175.66 rows=340 width=4) (actual time=0.330..1.157 rows=337 loops=3)

  • Filter: (active AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 587
11.          

SubPlan (forSeq Scan)

12. 0.200 0.200 ↑ 1.0 353 3

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 385
Planning time : 1.232 ms
Execution time : 1,225.521 ms