
EXPLAIN SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_singleton
  GROUP BY groupkey1, groupkey2;
CREATE TEMP TABLE tt(groupkey1, groupkey2, sum1, count1, sum2, count2) AS
  SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
    FROM hashagg_singleton
    GROUP BY groupkey1, groupkey2;
SELECT * FROM tt ORDER BY 1, 2;
DROP TABLE tt;

EXPLAIN SELECT DISTINCT groupkey1, groupkey2
  FROM hashagg_singleton;
CREATE TEMP TABLE tt(groupkey1, groupkey2) AS
  SELECT DISTINCT groupkey1, groupkey2
    FROM hashagg_singleton;
SELECT * FROM tt ORDER BY 1, 2;
DROP TABLE tt;

EXPLAIN SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_even
  GROUP BY groupkey1, groupkey2;
CREATE TEMP TABLE tt(groupkey1, groupkey2, sum1, count1, sum2, count2) AS
  SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
    FROM hashagg_even
    GROUP BY groupkey1, groupkey2;
SELECT * FROM tt ORDER BY 1, 2;
DROP TABLE tt;

EXPLAIN SELECT DISTINCT groupkey1, groupkey2
  FROM hashagg_even;
CREATE TEMP TABLE tt(groupkey1, groupkey2) AS
  SELECT DISTINCT groupkey1, groupkey2
    FROM hashagg_even;
SELECT * FROM tt ORDER BY 1, 2;
DROP TABLE tt;

EXPLAIN SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
  FROM hashagg_skew
  GROUP BY groupkey1, groupkey2;
CREATE TEMP TABLE tt(groupkey1, groupkey2, sum1, count1, sum2, count2) AS
  SELECT groupkey1, groupkey2, sum(arg1), count(arg1), sum(arg2), count(arg2)
    FROM hashagg_skew
    GROUP BY groupkey1, groupkey2;
SELECT * FROM tt ORDER BY 1, 2;
DROP TABLE tt;

EXPLAIN SELECT DISTINCT groupkey1, groupkey2
  FROM hashagg_skew;
CREATE TEMP TABLE tt(groupkey1, groupkey2) AS
  SELECT DISTINCT groupkey1, groupkey2
    FROM hashagg_skew;
SELECT * FROM tt ORDER BY 1, 2;
DROP TABLE tt;

