
set enable_hashagg=false;

EXPLAIN ANALYZE SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_singleton
  GROUP BY groupkey1, groupkey2;
EXPLAIN ANALYZE SELECT DISTINCT groupkey1, groupkey2 FROM hashagg_singleton;

EXPLAIN ANALYZE SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_even
  GROUP BY groupkey1, groupkey2;
EXPLAIN ANALYZE SELECT DISTINCT groupkey1, groupkey2 FROM hashagg_even;

EXPLAIN ANALYZE SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_skew
  GROUP BY groupkey1, groupkey2;
EXPLAIN ANALYZE SELECT DISTINCT groupkey1, groupkey2 FROM hashagg_skew;

set enable_hashagg=true;

EXPLAIN ANALYZE SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_singleton
  GROUP BY groupkey1, groupkey2;
EXPLAIN ANALYZE SELECT DISTINCT groupkey1, groupkey2 FROM hashagg_singleton;

EXPLAIN ANALYZE SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_even
  GROUP BY groupkey1, groupkey2;
EXPLAIN ANALYZE SELECT DISTINCT groupkey1, groupkey2 FROM hashagg_even;

EXPLAIN ANALYZE SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_skew
  GROUP BY groupkey1, groupkey2;
EXPLAIN ANALYZE SELECT DISTINCT groupkey1, groupkey2 FROM hashagg_skew;

