explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cWTy

Settings
# exclusive inclusive rows x rows loops node
1. 0.111 464.456 ↓ 2.0 300 1

Hash Join (cost=8,670.66..9,176.04 rows=150 width=16) (actual time=464.201..464.456 rows=300 loops=1)

  • Hash Cond: ((p.id = pr.planet_id) AND (s.class = pr.spacecraft_class))
2. 69.505 464.159 ↑ 66.7 300 1

HashAggregate (cost=8,661.16..8,861.16 rows=20,000 width=16) (actual time=463.995..464.159 rows=300 loops=1)

  • Group Key: s.class, p.id
3. 90.119 394.654 ↑ 1.0 200,000 1

Hash Join (cost=1,762.67..7,161.16 rows=200,000 width=8) (actual time=47.260..394.654 rows=200,000 loops=1)

  • Hash Cond: (b.pax_id = pax.id)
4. 55.890 298.966 ↑ 1.0 200,000 1

Hash Join (cost=1,482.67..6,355.94 rows=200,000 width=12) (actual time=41.590..298.966 rows=200,000 loops=1)

  • Hash Cond: (f.spacecraft_id = s.id)
5. 58.096 243.039 ↑ 1.0 200,000 1

Hash Join (cost=1,447.25..5,793.54 rows=200,000 width=12) (actual time=41.530..243.039 rows=200,000 loops=1)

  • Hash Cond: (f.planet_id = p.id)
6. 118.166 184.872 ↑ 1.0 200,000 1

Hash Join (cost=1,444.00..5,243.04 rows=200,000 width=12) (actual time=41.444..184.872 rows=200,000 loops=1)

  • Hash Cond: (b.flight_id = f.id)
7. 25.655 25.655 ↑ 1.0 200,000 1

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

8. 23.478 41.051 ↑ 1.0 50,000 1

Hash (cost=819.00..819.00 rows=50,000 width=12) (actual time=41.051..41.051 rows=50,000 loops=1)

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

Seq Scan on flight f (cost=0.00..819.00 rows=50,000 width=12) (actual time=0.024..17.573 rows=50,000 loops=1)

10. 0.037 0.071 ↑ 1.0 100 1

Hash (cost=2.00..2.00 rows=100 width=4) (actual time=0.071..0.071 rows=100 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
11. 0.034 0.034 ↑ 1.0 100 1

Seq Scan on planet p (cost=0.00..2.00 rows=100 width=4) (actual time=0.015..0.034 rows=100 loops=1)

12. 0.010 0.037 ↑ 86.9 13 1

Hash (cost=21.30..21.30 rows=1,130 width=8) (actual time=0.037..0.037 rows=13 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 17kB
13. 0.027 0.027 ↑ 86.9 13 1

Seq Scan on spacecraft s (cost=0.00..21.30 rows=1,130 width=8) (actual time=0.023..0.027 rows=13 loops=1)

14. 3.336 5.569 ↑ 1.0 10,000 1

Hash (cost=155.00..155.00 rows=10,000 width=4) (actual time=5.569..5.569 rows=10,000 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 480kB
15. 2.233 2.233 ↑ 1.0 10,000 1

Seq Scan on pax (cost=0.00..155.00 rows=10,000 width=4) (actual time=0.025..2.233 rows=10,000 loops=1)

16. 0.114 0.186 ↑ 1.0 300 1

Hash (cost=5.00..5.00 rows=300 width=12) (actual time=0.186..0.186 rows=300 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
17. 0.072 0.072 ↑ 1.0 300 1

Seq Scan on price pr (cost=0.00..5.00 rows=300 width=12) (actual time=0.031..0.072 rows=300 loops=1)

Planning time : 1.723 ms
Execution time : 465.804 ms