tpch10s=# set enable_hashagg=off; tpch10s=# set optimizer=on; tpch10s=# explain select sum(l_quantity), l_partkey, l_suppkey from lineitem group by l_partkey, l_suppkey; QUERY PLAN -------------------------------------------------------------------------------------------------------- Gather Motion 8:1 (slice2; segments: 8) (cost=0.00..6012.40 rows=59986052 width=16) -> HashAggregate (cost=0.00..3351.42 rows=7498257 width=16) Group Key: l_partkey, l_suppkey -> Redistribute Motion 8:8 (slice1; segments: 8) (cost=0.00..1457.66 rows=7498257 width=13) Hash Key: l_partkey, l_suppkey -> Seq Scan on lineitem (cost=0.00..971.25 rows=7498257 width=13) Optimizer: Pivotal Optimizer (GPORCA)