explain.depesz.com

PostgreSQL's explain analyze made readable

Result: E6my

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 21,611.521 ↑ 1.0 100 1

Limit (cost=732,755.05..732,969.13 rows=100 width=41) (actual time=21,610.865..21,611.521 rows=100 loops=1)

2. 0.106 21,611.482 ↑ 22,298.0 100 1

Merge Left Join (cost=732,755.05..5,506,259.98 rows=2,229,803 width=41) (actual time=21,610.864..21,611.482 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.163 0.163 ↑ 22,298.0 100 1

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

  • Filter: (date_max >= (now() - '28 days'::interval))
  • Rows Removed by Filter: 49
4. 0.210 21,611.213 ↑ 1,903.1 96 1

GroupAggregate (cost=732,754.62..737,421.22 rows=182,697 width=18) (actual time=21,610.822..21,611.213 rows=96 loops=1)

  • Group Key: stock_sales.store_key, stock_sales.article_key, stock_sales.color_key, stock_sales.size_key
5. 367.123 21,611.003 ↑ 374.9 505 1

Sort (cost=732,754.62..733,227.89 rows=189,309 width=12) (actual time=21,610.815..21,611.003 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. 21,243.880 21,243.880 ↓ 2.3 431,719 1

Seq Scan on stock_sales (cost=0.00..712,923.82 rows=189,309 width=12) (actual time=9.078..21,243.880 rows=431,719 loops=1)

  • Filter: ((date_key < now()) AND (date_key >= (now() - '28 days'::interval)))
  • Rows Removed by Filter: 23448844