explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SaRi

Settings
# exclusive inclusive rows x rows loops node
1. 0.042 534.018 ↑ 1.0 100 1

Limit (cost=216,107.48..216,321.60 rows=100 width=41) (actual time=533.340..534.018 rows=100 loops=1)

2. 0.123 533.976 ↑ 22,297.9 100 1

Merge Left Join (cost=216,107.48..4,990,534.34 rows=2,229,793 width=41) (actual time=533.338..533.976 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.173 0.173 ↑ 22,297.9 100 1

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

  • Filter: (date_max >= (now() - '28 days'::interval))
  • Rows Removed by Filter: 49
4. 0.196 533.680 ↑ 2,111.1 96 1

GroupAggregate (cost=216,107.05..221,296.37 rows=202,663 width=18) (actual time=533.316..533.680 rows=96 loops=1)

  • Group Key: stock_sales.store_key, stock_sales.article_key, stock_sales.color_key, stock_sales.size_key
5. 328.126 533.484 ↑ 417.5 505 1

Sort (cost=216,107.05..216,634.16 rows=210,846 width=12) (actual time=533.307..533.484 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. 144.853 205.358 ↓ 2.0 431,719 1

Bitmap Heap Scan on stock_sales (cost=4,477.62..193,857.11 rows=210,846 width=12) (actual time=61.655..205.358 rows=431,719 loops=1)

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

Bitmap Index Scan on stock_sales_date_key_idx (cost=0.00..4,424.91 rows=210,846 width=0) (actual time=60.505..60.505 rows=431,719 loops=1)

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