explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QChd

Settings
# exclusive inclusive rows x rows loops node
1. 0.046 3,920.018 ↑ 1.0 100 1

Limit (cost=217,043.12..217,257.24 rows=100 width=41) (actual time=3,919.350..3,920.018 rows=100 loops=1)

2. 0.107 3,919.972 ↑ 22,298.0 100 1

Merge Left Join (cost=217,043.12..4,991,470.92 rows=2,229,798 width=41) (actual time=3,919.349..3,919.972 rows=100 loops=1)

  • Merge 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))
3. 0.167 0.167 ↑ 22,298.0 100 1

Index Scan using skus_pkey on skus s (cost=0.43..4,742,886.75 rows=2,229,798 width=23) (actual time=0.017..0.167 rows=100 loops=1)

  • Filter: (date_max >= (now() - '28 days'::interval))
  • Rows Removed by Filter: 49
4. 0.207 3,919.698 ↑ 2,111.3 96 1

GroupAggregate (cost=217,042.68..222,232.51 rows=202,682 width=18) (actual time=3,919.326..3,919.698 rows=96 loops=1)

  • Group Key: stock_sales.store_key, stock_sales.article_key, stock_sales.color_key, stock_sales.size_key
5. 397.819 3,919.491 ↑ 417.6 505 1

Sort (cost=217,042.68..217,569.85 rows=210,867 width=12) (actual time=3,919.318..3,919.491 rows=505 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. 3,405.518 3,521.672 ↓ 2.0 431,719 1

Bitmap Heap Scan on stock_sales (cost=5,409.96..194,790.74 rows=210,867 width=12) (actual time=118.362..3,521.672 rows=431,719 loops=1)

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

Bitmap Index Scan on stock_sales_date_key_store_key_article_key_color_key_size_k_idx (cost=0.00..5,357.24 rows=210,867 width=0) (actual time=116.154..116.154 rows=431,719 loops=1)

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