explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C1rC

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 725.775 ↑ 1.0 10 1

Limit (cost=17,024.84..17,024.87 rows=10 width=133) (actual time=725.773..725.775 rows=10 loops=1)

  • Buffers: shared hit=23 read=1392
2. 1.355 725.772 ↑ 74.2 11 1

Sort (cost=17,024.84..17,026.88 rows=816 width=133) (actual time=725.771..725.772 rows=11 loops=1)

  • Sort Key: c.state, (sum(o.totalamount))
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=23 read=1392
3. 370.132 724.417 ↓ 1.0 832 1

Aggregate (cost=16,994.41..17,006.65 rows=816 width=133) (actual time=723.877..724.417 rows=832 loops=1)

  • Buffers: shared hit=13 read=1392
4. 125.191 354.285 ↓ 1.2 383,270 1

Hash Join (cost=4,966.48..13,742.65 rows=325,176 width=133) (actual time=118.314..354.285 rows=383,270 loops=1)

  • Buffers: shared hit=13 read=1392
5. 37.678 133.484 ↑ 1.0 60,350 1

Hash Join (cost=834.86..4,539.11 rows=60,350 width=138) (actual time=22.651..133.484 rows=60,350 loops=1)

  • Buffers: shared hit=9 read=581
6. 59.147 85.647 ↑ 1.0 60,350 1

Hash Join (cost=464.86..2,962.11 rows=60,350 width=122) (actual time=12.467..85.647 rows=60,350 loops=1)

  • Buffers: shared hit=4 read=483
7. 14.054 14.054 ↑ 1.0 60,350 1

Seq Scan on orderlines ol (cost=0..988.5 rows=60,350 width=8) (actual time=0.005..14.054 rows=60,350 loops=1)

  • Buffers: shared hit=2 read=383
8. 3.431 12.446 ↑ 1.0 10,000 1

Hash (cost=339.86..339.86 rows=10,000 width=122) (actual time=12.446..12.446 rows=10,000 loops=1)

  • Buffers: shared hit=2 read=100
9. 4.420 9.015 ↑ 1.0 10,000 1

Hash Join (cost=1.36..339.86 rows=10,000 width=122) (actual time=0.283..9.015 rows=10,000 loops=1)

  • Buffers: shared hit=2 read=100
10. 4.330 4.330 ↑ 1.0 10,000 1

Seq Scan on products p (cost=0..201 rows=10,000 width=8) (actual time=0.003..4.33 rows=10,000 loops=1)

  • Buffers: shared hit=2 read=99
11. 0.013 0.265 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=122) (actual time=0.265..0.265 rows=16 loops=1)

  • Buffers: shared read=1
12. 0.252 0.252 ↑ 1.0 16 1

Seq Scan on categories cat (cost=0..1.16 rows=16 width=122) (actual time=0.25..0.252 rows=16 loops=1)

  • Buffers: shared read=1
13. 4.611 10.159 ↑ 1.0 12,000 1

Hash (cost=220..220 rows=12,000 width=16) (actual time=10.159..10.159 rows=12,000 loops=1)

  • Buffers: shared hit=2 read=98
14. 5.548 5.548 ↑ 1.0 12,000 1

Seq Scan on orders o (cost=0..220 rows=12,000 width=16) (actual time=0.008..5.548 rows=12,000 loops=1)

  • Buffers: shared hit=2 read=98
15. 20.971 95.610 ↑ 1.0 60,350 1

Hash (cost=3,377.25..3,377.25 rows=60,350 width=7) (actual time=95.61..95.61 rows=60,350 loops=1)

  • Buffers: shared hit=4 read=811
16. 39.041 74.639 ↑ 1.0 60,350 1

Hash Join (cost=938..3,377.25 rows=60,350 width=7) (actual time=24.115..74.639 rows=60,350 loops=1)

  • Buffers: shared hit=4 read=811
17. 11.812 11.812 ↑ 1.0 60,350 1

Seq Scan on cust_hist ch (cost=0..930.5 rows=60,350 width=8) (actual time=0.294..11.812 rows=60,350 loops=1)

  • Buffers: shared hit=2 read=325
18. 7.015 23.786 ↑ 1.0 20,000 1

Hash (cost=688..688 rows=20,000 width=7) (actual time=23.786..23.786 rows=20,000 loops=1)

  • Buffers: shared hit=2 read=486
19. 16.771 16.771 ↑ 1.0 20,000 1

Seq Scan on customers c (cost=0..688 rows=20,000 width=7) (actual time=0.005..16.771 rows=20,000 loops=1)

  • Buffers: shared hit=2 read=486