explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Quo8

Settings
# exclusive inclusive rows x rows loops node
1. 67.867 158.556 ↑ 4.0 50 1

HashAggregate (cost=3,467.07..3,469.57 rows=200 width=158) (actual time=158.533..158.556 rows=50 loops=1)

  • Group Key: st.state_name
2. 29.371 90.689 ↑ 1.0 100,000 1

Hash Join (cost=51.65..2,216.96 rows=100,009 width=127) (actual time=0.692..90.689 rows=100,000 loops=1)

  • Hash Cond: (c.state_id = st.state_id)
3. 40.173 61.260 ↑ 1.0 100,000 1

Hash Join (cost=29.50..1,930.23 rows=100,009 width=13) (actual time=0.546..61.260 rows=100,000 loops=1)

  • Hash Cond: (s.customer_id = c.customer_id)
4. 20.586 20.586 ↑ 1.0 100,000 1

Seq Scan on sale s (cost=0.00..1,637.09 rows=100,009 width=13) (actual time=0.019..20.586 rows=100,000 loops=1)

5. 0.237 0.501 ↑ 1.0 1,000 1

Hash (cost=17.00..17.00 rows=1,000 width=8) (actual time=0.501..0.501 rows=1,000 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
6. 0.264 0.264 ↑ 1.0 1,000 1

Seq Scan on customer c (cost=0.00..17.00 rows=1,000 width=8) (actual time=0.013..0.264 rows=1,000 loops=1)

7. 0.026 0.058 ↑ 10.8 50 1

Hash (cost=15.40..15.40 rows=540 width=122) (actual time=0.058..0.058 rows=50 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
8. 0.032 0.032 ↑ 10.8 50 1

Seq Scan on state st (cost=0.00..15.40 rows=540 width=122) (actual time=0.021..0.032 rows=50 loops=1)