explain (analyze, costs off, timing off) select dept, sdate, item_class, store, sum(total_sales) from sales_mdam_paper where -- "dept" column omitted from qual sdate between '1995-06-01' and '1995-06-30' and item_class in (20, 35, 50) and store in (200, 250) group by dept, sdate, item_class, store order by dept, sdate, item_class, store; QUERY PLAN -------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=18000.00 loops=1) Group Key: dept, sdate, item_class, store Buffers: shared hit=54014 -> Index Scan using mdam_idx on sales_mdam_paper (actual rows=18000.00 loops=1) Index Cond: ((sdate >= '1995-06-01'::date) AND (sdate <= '1995-06-30'::date) AND ... Index Searches: 9002 Buffers: shared hit=54014 Planning: Buffers: shared hit=133 Planning Time: 0.550 ms Execution Time: 45.910 ms (11 rows)