explain.depesz.com

PostgreSQL's explain analyze made readable

Result: f7Ek

Settings
# exclusive inclusive rows x rows loops node
1. 0.088 828.283 ↓ 4.2 50 1

WindowAgg (cost=648.15..649.56 rows=12 width=68) (actual time=819.368..828.283 rows=50 loops=1)

2. 7.603 828.195 ↓ 4.2 50 1

GroupAggregate (cost=648.15..649.08 rows=12 width=76) (actual time=819.173..828.195 rows=50 loops=1)

  • Group Key: calendar.date_key
  • Filter: (sum(stock_sales.end_stock) IS NOT NULL)
3. 8.158 820.592 ↓ 765.3 27,550 1

Sort (cost=648.15..648.24 rows=36 width=32) (actual time=818.976..820.592 rows=27,550 loops=1)

  • Sort Key: calendar.date_key
  • Sort Method: quicksort Memory: 2577kB
4. 3.413 812.434 ↓ 765.3 27,550 1

Nested Loop Left Join (cost=10.15..647.22 rows=36 width=32) (actual time=2.487..812.434 rows=27,550 loops=1)

5. 12.969 450.871 ↓ 765.3 27,550 1

Nested Loop Left Join (cost=9.59..337.26 rows=36 width=28) (actual time=0.545..450.871 rows=27,550 loops=1)

6. 5.271 24.652 ↓ 765.3 27,550 1

Nested Loop (cost=4.85..26.13 rows=36 width=18) (actual time=0.538..24.652 rows=27,550 loops=1)

7. 0.021 0.031 ↓ 4.2 50 1

Bitmap Heap Scan on calendar (cost=4.42..17.18 rows=12 width=4) (actual time=0.015..0.031 rows=50 loops=1)

  • Recheck Cond: ((date_key >= ((now())::date - 14)) AND (date_key <= ((now())::date + 35)))
  • Heap Blocks: exact=1
8. 0.010 0.010 ↓ 4.2 50 1

Bitmap Index Scan on calendar_pkey (cost=0.00..4.42 rows=12 width=0) (actual time=0.010..0.010 rows=50 loops=1)

  • Index Cond: ((date_key >= ((now())::date - 14)) AND (date_key <= ((now())::date + 35)))
9. 2.406 19.350 ↓ 183.7 551 50

Materialize (cost=0.43..8.51 rows=3 width=14) (actual time=0.011..0.387 rows=551 loops=50)

10. 16.944 16.944 ↓ 183.7 551 1

Index Only Scan using article_color_store_size_sku_idx on skus sk (cost=0.43..8.49 rows=3 width=14) (actual time=0.519..16.944 rows=551 loops=1)

  • Index Cond: ((article_key = 26701) AND (color_key = 369))
  • Heap Fetches: 451
11. 137.750 413.250 ↓ 0.0 0 27,550

Bitmap Heap Scan on stock_predictions p (cost=4.74..2,452.10 rows=627 width=22) (actual time=0.015..0.015 rows=0 loops=27,550)

  • Recheck Cond: ((sku_key = sk.sku_key) AND (date_key = calendar.date_key) AND (date_key >= now()))
  • Heap Blocks: exact=2289
12. 275.500 275.500 ↓ 0.0 0 27,550

Bitmap Index Scan on predictions_pkey (cost=0.00..4.58 rows=627 width=0) (actual time=0.010..0.010 rows=0 loops=27,550)

  • Index Cond: ((sku_key = sk.sku_key) AND (date_key = calendar.date_key) AND (date_key >= now()))
13. 27.550 358.150 ↑ 1.0 1 27,550

Limit (cost=0.56..8.59 rows=1 width=14) (actual time=0.013..0.013 rows=1 loops=27,550)

14. 330.600 330.600 ↑ 1.0 1 27,550

Index Scan Backward using stock_sales_store_key_article_key_color_key_size_key_date_k_idx on stock_sales (cost=0.56..8.59 rows=1 width=14) (actual time=0.012..0.012 rows=1 loops=27,550)

  • Index Cond: ((store_key = sk.store_key) AND (article_key = sk.article_key) AND (color_key = sk.color_key) AND (size_key = sk.size_key) AND (date_key <= calendar.date_key))