summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2013-12-12 16:24:38 +0000
committerTom Lane2013-12-12 16:24:38 +0000
commitf26099057a2818d85edc2a16e2d3161f4bd96bdc (patch)
tree29b6731dc96a204de8f09423b6325dd0f47c30db /src/test
parent8693559cacf1765697c32fc38574af3c19ce61c1 (diff)
Improve EXPLAIN to print the grouping columns in Agg and Group nodes.
Per request from Kevin Grittner.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/aggregates.out6
-rw-r--r--src/test/regress/expected/matview.out9
-rw-r--r--src/test/regress/expected/union.out10
-rw-r--r--src/test/regress/expected/window.out7
4 files changed, 20 insertions, 12 deletions
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index c05b39cb89d..1a0ca5c5f3c 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -659,12 +659,13 @@ explain (costs off)
QUERY PLAN
---------------------------------------------------------------------
HashAggregate
+ Group Key: $0
InitPlan 1 (returns $0)
-> Limit
-> Index Only Scan Backward using tenk1_unique2 on tenk1
Index Cond: (unique2 IS NOT NULL)
-> Result
-(6 rows)
+(7 rows)
select distinct max(unique2) from tenk1;
max
@@ -806,6 +807,7 @@ explain (costs off)
QUERY PLAN
----------------------------------------------------------------------------------------------
HashAggregate
+ Group Key: $0, $1
InitPlan 1 (returns $0)
-> Limit
-> Merge Append
@@ -831,7 +833,7 @@ explain (costs off)
-> Index Only Scan Backward using minmaxtest3i on minmaxtest3 minmaxtest3_1
Index Cond: (f1 IS NOT NULL)
-> Result
-(26 rows)
+(27 rows)
select distinct min(f1), max(f1) from minmaxtest;
min | max
diff --git a/src/test/regress/expected/matview.out b/src/test/regress/expected/matview.out
index 9ba2b9a7b48..31751ebd9ed 100644
--- a/src/test/regress/expected/matview.out
+++ b/src/test/regress/expected/matview.out
@@ -22,8 +22,9 @@ EXPLAIN (costs off)
QUERY PLAN
---------------------
HashAggregate
+ Group Key: type
-> Seq Scan on t
-(2 rows)
+(3 rows)
CREATE MATERIALIZED VIEW tm AS SELECT type, sum(amt) AS totamt FROM t GROUP BY type WITH NO DATA;
SELECT relispopulated FROM pg_class WHERE oid = 'tm'::regclass;
@@ -59,8 +60,9 @@ EXPLAIN (costs off)
Sort
Sort Key: t.type
-> HashAggregate
+ Group Key: t.type
-> Seq Scan on t
-(4 rows)
+(5 rows)
CREATE MATERIALIZED VIEW tvm AS SELECT * FROM tv ORDER BY type;
SELECT * FROM tvm;
@@ -82,8 +84,9 @@ EXPLAIN (costs off)
---------------------------
Aggregate
-> HashAggregate
+ Group Key: t.type
-> Seq Scan on t
-(3 rows)
+(4 rows)
CREATE MATERIALIZED VIEW tvvm AS SELECT * FROM tvv;
CREATE VIEW tvvmv AS SELECT * FROM tvvm;
diff --git a/src/test/regress/expected/union.out b/src/test/regress/expected/union.out
index ae690cf9689..6f9ee5eb471 100644
--- a/src/test/regress/expected/union.out
+++ b/src/test/regress/expected/union.out
@@ -494,12 +494,13 @@ explain (costs off)
QUERY PLAN
---------------------------------------------------
HashAggregate
+ Group Key: ((t1.a || t1.b))
-> Append
-> Index Scan using t1_ab_idx on t1
Index Cond: ((a || b) = 'ab'::text)
-> Index Only Scan using t2_pkey on t2
Index Cond: (ab = 'ab'::text)
-(6 rows)
+(7 rows)
reset enable_seqscan;
reset enable_indexscan;
@@ -552,17 +553,18 @@ SELECT * FROM
SELECT 2 AS t, 4 AS x) ss
WHERE x < 4
ORDER BY x;
- QUERY PLAN
---------------------------------
+ QUERY PLAN
+--------------------------------------------------------
Sort
Sort Key: ss.x
-> Subquery Scan on ss
Filter: (ss.x < 4)
-> HashAggregate
+ Group Key: (1), (generate_series(1, 10))
-> Append
-> Result
-> Result
-(8 rows)
+(9 rows)
SELECT * FROM
(SELECT 1 AS t, generate_series(1,10) AS x
diff --git a/src/test/regress/expected/window.out b/src/test/regress/expected/window.out
index 1e6365b4f9b..0f21fcb01da 100644
--- a/src/test/regress/expected/window.out
+++ b/src/test/regress/expected/window.out
@@ -619,12 +619,13 @@ explain (costs off)
select first_value(max(x)) over (), y
from (select unique1 as x, ten+four as y from tenk1) ss
group by y;
- QUERY PLAN
--------------------------------
+ QUERY PLAN
+---------------------------------------------
WindowAgg
-> HashAggregate
+ Group Key: (tenk1.ten + tenk1.four)
-> Seq Scan on tenk1
-(3 rows)
+(4 rows)
-- test non-default frame specifications
SELECT four, ten,