explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G8qJ

Settings
# exclusive inclusive rows x rows loops node
1. 63.623 149.536 ↑ 4.0 50 1

HashAggregate (cost=3,466.82..3,469.32 rows=200 width=158) (actual time=149.514..149.536 rows=50 loops=1)

  • Group Key: st.state_name
2. 28.012 85.913 ↑ 1.0 100,000 1

Hash Join (cost=51.65..2,216.82 rows=100,000 width=154) (actual time=0.706..85.913 rows=100,000 loops=1)

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

Hash Join (cost=29.50..1,930.11 rows=100,000 width=40) (actual time=0.560..57.827 rows=100,000 loops=1)

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

Seq Scan on sale s (cost=0.00..1,637.00 rows=100,000 width=40) (actual time=0.018..19.298 rows=100,000 loops=1)

5. 0.236 0.515 ↑ 1.0 1,000 1

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

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

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

7. 0.029 0.074 ↑ 10.8 50 1

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

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

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