explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2vbF

Settings
# exclusive inclusive rows x rows loops node
1. 2,254.476 6,756.899 ↑ 1.0 2,199,216 1

Hash Left Join (cost=228,562.71..415,797.82 rows=2,229,792 width=41) (actual time=1,089.164..6,756.899 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. 3,486.494 3,486.494 ↑ 1.0 2,199,216 1

Seq Scan on skus s (cost=0.00..136,502.30 rows=2,229,792 width=23) (actual time=3.954..3,486.494 rows=2,199,216 loops=1)

  • Filter: (date_max >= (now() - '28 days'::interval))
  • Rows Removed by Filter: 3079743
3. 87.833 1,015.929 ↓ 1.0 205,378 1

Hash (cost=223,321.57..223,321.57 rows=202,657 width=18) (actual time=1,015.929..1,015.929 rows=205,378 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 3324kB
4. 258.248 928.096 ↓ 1.0 205,378 1

GroupAggregate (cost=216,105.84..221,295.00 rows=202,657 width=18) (actual time=536.829..928.096 rows=205,378 loops=1)

  • Group Key: stock_sales.store_key, stock_sales.article_key, stock_sales.color_key, stock_sales.size_key
5. 469.567 669.848 ↓ 2.0 431,719 1

Sort (cost=216,105.84..216,632.94 rows=210,839 width=12) (actual time=536.819..669.848 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
6. 142.063 200.281 ↓ 2.0 431,719 1

Bitmap Heap Scan on stock_sales (cost=4,477.54..193,856.58 rows=210,839 width=12) (actual time=59.368..200.281 rows=431,719 loops=1)

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

Bitmap Index Scan on stock_sales_date_key_idx (cost=0.00..4,424.84 rows=210,839 width=0) (actual time=58.218..58.218 rows=431,719 loops=1)

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