explain.depesz.com

PostgreSQL's explain analyze made readable

Result: E0H

Settings
# exclusive inclusive rows x rows loops node
1. 64.911 262.352 ↑ 29.6 563 1

HashAggregate (cost=6,120.02..6,911.69 rows=16,667 width=8) (actual time=250.607..262.352 rows=563 loops=1)

  • Group Key: f.id
  • Filter: ((count(p.id))::integer > 4)
  • Rows Removed by Filter: 36,145
2. 48.870 197.441 ↓ 1.0 66,521 1

Hash Join (cost=1,648.08..5,621.72 rows=66,440 width=8) (actual time=28.000..197.441 rows=66,521 loops=1)

  • Hash Cond: (b.flight_id = f.id)
3. 86.081 123.394 ↓ 1.0 66,521 1

Hash Join (cost=204.08..4,003.30 rows=66,440 width=8) (actual time=2.222..123.394 rows=66,521 loops=1)

  • Hash Cond: (b.pax_id = p.id)
4. 35.152 35.152 ↑ 1.0 200,000 1

Seq Scan on booking b (cost=0.00..3,274.00 rows=200,000 width=8) (actual time=0.021..35.152 rows=200,000 loops=1)

5. 0.877 2.161 ↑ 1.0 3,322 1

Hash (cost=162.56..162.56 rows=3,322 width=4) (actual time=2.161..2.161 rows=3,322 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 149kB
6. 1.078 1.284 ↑ 1.0 3,322 1

Bitmap Heap Scan on pax p (cost=66.03..162.56 rows=3,322 width=4) (actual time=0.220..1.284 rows=3,322 loops=1)

  • Recheck Cond: (race = 'Men'::race)
  • Heap Blocks: exact=55
7. 0.206 0.206 ↑ 1.0 3,322 1

Bitmap Index Scan on idx_pax (cost=0.00..65.20 rows=3,322 width=0) (actual time=0.206..0.206 rows=3,322 loops=1)

  • Index Cond: (race = 'Men'::race)
8. 14.617 25.177 ↑ 1.0 50,000 1

Hash (cost=819.00..819.00 rows=50,000 width=4) (actual time=25.176..25.177 rows=50,000 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,270kB
9. 10.560 10.560 ↑ 1.0 50,000 1

Seq Scan on flight f (cost=0.00..819.00 rows=50,000 width=4) (actual time=0.026..10.560 rows=50,000 loops=1)