explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rush

Settings
# exclusive inclusive rows x rows loops node
1. 2,069.937 9,888.218 ↑ 1.0 2,199,216 1

Hash Left Join (cost=270,266.36..403,968.40 rows=2,227,680 width=41) (actual time=1,548.653..9,888.218 rows=2,199,216 loops=1)

  • Hash Cond: ((s.store_key = stock_sales.store_key) AND (s.article_key = stock_sales.article_key) AND (s.color_key = stock_sales.color_key) AND (s.size_key = stock_sales.size_key))
2. 6,275.106 6,819.441 ↑ 1.0 2,199,216 1

Bitmap Heap Scan on skus s (cost=41,704.96..124,722.36 rows=2,227,680 width=23) (actual time=548.508..6,819.441 rows=2,199,216 loops=1)

  • Recheck Cond: (date_max >= (now() - '28 days'::interval))
  • Heap Blocks: exact=26493
3. 544.335 544.335 ↑ 1.0 2,199,216 1

Bitmap Index Scan on skus_date_max_idx (cost=0.00..41,148.04 rows=2,227,680 width=0) (actual time=544.335..544.335 rows=2,199,216 loops=1)

  • Index Cond: (date_max >= (now() - '28 days'::interval))
4. 86.326 998.840 ↓ 1.0 205,378 1

Hash (cost=223,320.38..223,320.38 rows=202,651 width=18) (actual time=998.840..998.840 rows=205,378 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 3324kB
5. 200.067 912.514 ↓ 1.0 205,378 1

GroupAggregate (cost=216,104.87..221,293.87 rows=202,651 width=18) (actual time=575.963..912.514 rows=205,378 loops=1)

  • Group Key: stock_sales.store_key, stock_sales.article_key, stock_sales.color_key, stock_sales.size_key
6. 467.665 712.447 ↓ 2.0 431,719 1

Sort (cost=216,104.87..216,631.95 rows=210,833 width=12) (actual time=575.952..712.447 rows=431,719 loops=1)

  • Sort Key: stock_sales.store_key, stock_sales.article_key, stock_sales.color_key, stock_sales.size_key
  • Sort Method: external merge Disk: 10144kB
7. 143.364 244.782 ↓ 2.0 431,719 1

Bitmap Heap Scan on stock_sales (cost=4,477.48..193,856.18 rows=210,833 width=12) (actual time=102.561..244.782 rows=431,719 loops=1)

  • Recheck Cond: ((date_key < now()) AND (date_key >= (now() - '28 days'::interval)))
  • Heap Blocks: exact=7820
8. 101.418 101.418 ↓ 2.0 431,719 1

Bitmap Index Scan on stock_sales_date_key_idx (cost=0.00..4,424.77 rows=210,833 width=0) (actual time=101.417..101.418 rows=431,719 loops=1)

  • Index Cond: ((date_key < now()) AND (date_key >= (now() - '28 days'::interval)))