explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7sBy

Settings
# exclusive inclusive rows x rows loops node
1. 2,483.913 10,915.578 ↓ 3.0 558,732 1

GroupAggregate (cost=2.28..119,560.85 rows=186,239 width=48) (actual time=1.173..10,915.578 rows=558,732 loops=1)

  • Group Key: s.sale_id
  • Buffers: shared hit=4888290 read=21359
2.          

CTE cdf

3. 0.008 0.186 ↑ 1.0 7 1

WindowAgg (cost=1.29..1.43 rows=7 width=32) (actual time=0.183..0.186 rows=7 loops=1)

  • Buffers: shared hit=3 read=1
4. 0.015 0.178 ↑ 1.0 7 1

Sort (cost=1.29..1.3 rows=7 width=24) (actual time=0.178..0.178 rows=7 loops=1)

  • Sort Key: a_1.item_order
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=3 read=1
5. 0.163 0.163 ↑ 1.0 7 1

Seq Scan on attribute a_1 (cost=0..1.19 rows=7 width=24) (actual time=0.161..0.163 rows=7 loops=1)

  • Filter: (a_1.attribute_type = 'SALE'::enum.attribute_type)
  • Buffers: shared read=1
6. 1,653.742 8,431.665 ↓ 10.5 3,911,124 1

Merge Join (cost=0.85..105,125.9 rows=372,478 width=113) (actual time=0.202..8,431.665 rows=3,911,124 loops=1)

  • Buffers: shared hit=4888282 read=21359
7. 659.403 1,838.627 ↓ 10.5 3,911,124 1

Nested Loop (cost=0.42..43,595.14 rows=372,478 width=40) (actual time=0.194..1,838.627 rows=3,911,124 loops=1)

  • Buffers: shared hit=525391 read=2109
8. 620.492 620.492 ↓ 3.0 558,732 1

Index Scan using sale_pkey on sale s (cost=0.42..36,145.44 rows=186,239 width=16) (actual time=0.007..620.492 rows=558,732 loops=1)

  • Filter: upper_inf(s.active_range)
  • Buffers: shared hit=525388 read=2108
9. 558.732 558.732 ↓ 3.5 7 558,732

CTE Scan on cdf a (cost=0..0.16 rows=2 width=24) (actual time=0..0.001 rows=7 loops=558,732)

  • Filter: (a.row_number <= 12)
  • Buffers: shared hit=3 read=1
10. 4,939.296 4,939.296 ↓ 4.3 5,204,297 1

Index Scan using sale_attribute_pkey on sale_attribute sa (cost=0.43..47,335.66 rows=1,224,360 width=121) (actual time=0.006..4,939.296 rows=5,204,297 loops=1)

  • Buffers: shared hit=4362891 read=19250
Planning time : 8.787 ms
Execution time : 10,961.609 ms