BEGIN; BEGIN EXPLAIN select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= date '1998-12-01' - interval '106 days' group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=41692330.02..41692330.04 rows=6 width=20) Sort Key: l_returnflag, l_linestatus -> HashAggregate (cost=41692329.84..41692329.95 rows=6 width=20) Group Key: l_returnflag, l_linestatus -> Remote Subquery Scan on all (datanode_1_1,datanode_2_1,datanode_3_1,datanode_4_1,datanode_5_1,datanode_6_1,datanode_7_1,datanode_8_1) (cost=0.00..18157651.60 rows=588366956 width=20) -> HashAggregate (cost=0.00..18157651.60 rows=6 width=20) Group Key: l_returnflag, l_linestatus -> Seq Scan on lineitem (cost=0.00..18157651.60 rows=588366956 width=20) Filter: (l_shipdate <= '1998-08-17 00:00:00'::timestamp without time zone) (9 rows) COMMIT; COMMIT