explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oOvf

Settings
# exclusive inclusive rows x rows loops node
1. 57.116 1,078.597 ↑ 5.2 66 1

GroupAggregate (cost=469,445.96..473,521.42 rows=340 width=12) (actual time=1,000.545..1,078.597 rows=66 loops=1)

  • Group Key: api_rule.id
2. 73.953 1,021.481 ↑ 3.6 149,263 1

Sort (cost=469,445.96..470,803.31 rows=542,942 width=20) (actual time=1,000.527..1,021.481 rows=149,263 loops=1)

  • Sort Key: api_rule.id
  • Sort Method: external merge Disk: 4392kB
3. 6.276 947.528 ↑ 3.6 149,263 1

Gather (cost=26,671.93..406,592.54 rows=542,942 width=20) (actual time=27.318..947.528 rows=149,263 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 19.635 941.252 ↑ 4.5 49,754 3

Hash Join (cost=25,671.93..351,298.34 rows=226,226 width=20) (actual time=26.018..941.252 rows=49,754 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
5. 306.705 920.170 ↑ 6.4 96,486 3

Merge Join (cost=25,492.02..349,497.18 rows=614,802 width=20) (actual time=24.473..920.170 rows=96,486 loops=3)

  • Merge Cond: (api_report.upload_id = api_upload.id)
6. 589.462 589.462 ↑ 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.100..589.462 rows=4,654,837 loops=3)

  • Heap Fetches: 0
7. 9.613 24.003 ↑ 5.1 20,634 3

Sort (cost=25,491.46..25,755.16 rows=105,483 width=20) (actual time=21.924..24.003 rows=20,634 loops=3)

  • Sort Key: api_upload.id
  • Sort Method: quicksort Memory: 2381kB
8. 10.895 14.390 ↑ 5.1 20,634 3

Bitmap Heap Scan on api_upload (cost=2,241.63..14,524.17 rows=105,483 width=20) (actual time=3.789..14.390 rows=20,634 loops=3)

  • Recheck Cond: ((account)::text = '729650'::text)
  • Filter: current
  • Heap Blocks: exact=1820
9. 3.495 3.495 ↑ 5.1 20,634 3

Bitmap Index Scan on api_upload_current_account_index (cost=0.00..2,215.26 rows=105,483 width=0) (actual time=3.495..3.495 rows=20,634 loops=3)

  • Index Cond: ((current = true) AND ((account)::text = '729650'::text))
10. 0.134 1.447 ↑ 1.0 337 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
11. 1.067 1.313 ↑ 1.0 337 3

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

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

SubPlan (forSeq Scan)

13. 0.246 0.246 ↑ 1.0 353 3

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

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