explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lOiU

Settings
# exclusive inclusive rows x rows loops node
1. 4.298 14.889 ↑ 4.0 50 1

HashAggregate (cost=421.05..423.55 rows=200 width=158) (actual time=14.876..14.889 rows=50 loops=1)

  • Group Key: st.state_name
2. 1.892 10.591 ↓ 1.5 10,000 1

Hash Join (cost=166.86..335.45 rows=6,848 width=154) (actual time=3.885..10.591 rows=10,000 loops=1)

  • Hash Cond: (c.state_id = st.state_id)
3. 2.910 8.647 ↓ 1.5 10,000 1

Hash Join (cost=144.71..295.18 rows=6,848 width=40) (actual time=3.808..8.647 rows=10,000 loops=1)

  • Hash Cond: (s.customer_id = c.customer_id)
4. 1.989 1.989 ↓ 1.5 10,000 1

Seq Scan on sale s (cost=0.00..132.48 rows=6,848 width=40) (actual time=0.024..1.989 rows=10,000 loops=1)

5. 1.807 3.748 ↓ 2.9 10,000 1

Hash (cost=100.98..100.98 rows=3,498 width=8) (actual time=3.748..3.748 rows=10,000 loops=1)

  • Buckets: 16384 (originally 4096) Batches: 1 (originally 1) Memory Usage: 519kB
6. 1.941 1.941 ↓ 2.9 10,000 1

Seq Scan on customer c (cost=0.00..100.98 rows=3,498 width=8) (actual time=0.016..1.941 rows=10,000 loops=1)

7. 0.017 0.052 ↑ 10.8 50 1

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

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

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