aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-08-30 09:59:23 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-08-30 09:59:23 -0400
commit6c2c5bea3cec4c874d1ee225bb6e222055c03d75 (patch)
tree8fd9c55c0838ca310ea461b02b7e53ecca128810 /src
parent7df2c1f8daeb361133ac8bdeaf59ceb0484e315a (diff)
downloadpostgresql-6c2c5bea3cec4c874d1ee225bb6e222055c03d75.tar.gz
postgresql-6c2c5bea3cec4c874d1ee225bb6e222055c03d75.zip
Restore test case from a2b70c89ca1a5fcf6181d3c777d82e7b83d2de1b.
Revert the reversion commits a20aac890 and 9b644745c. In the wake of commit 7df2c1f8d, we should get stable buildfarm results from this test; if not, I'd like to know sooner not later. Discussion: https://postgr.es/m/CAA4eK1JkByysFJNh9M349u_nNjqETuEnY_y1VUc_kJiU0bxtaQ@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/select_parallel.out43
-rw-r--r--src/test/regress/sql/select_parallel.sql16
2 files changed, 59 insertions, 0 deletions
diff --git a/src/test/regress/expected/select_parallel.out b/src/test/regress/expected/select_parallel.out
index ccad18e978f..888da5abf2a 100644
--- a/src/test/regress/expected/select_parallel.out
+++ b/src/test/regress/expected/select_parallel.out
@@ -300,6 +300,49 @@ select count(*) from tenk1 group by twenty;
500
(20 rows)
+--test rescan behavior of gather merge
+set enable_material = false;
+explain (costs off)
+select * from
+ (select string4, count(unique2)
+ from tenk1 group by string4 order by string4) ss
+ right join (values (1),(2),(3)) v(x) on true;
+ QUERY PLAN
+----------------------------------------------------------
+ Nested Loop Left Join
+ -> Values Scan on "*VALUES*"
+ -> Finalize GroupAggregate
+ Group Key: tenk1.string4
+ -> Gather Merge
+ Workers Planned: 4
+ -> Partial GroupAggregate
+ Group Key: tenk1.string4
+ -> Sort
+ Sort Key: tenk1.string4
+ -> Parallel Seq Scan on tenk1
+(11 rows)
+
+select * from
+ (select string4, count(unique2)
+ from tenk1 group by string4 order by string4) ss
+ right join (values (1),(2),(3)) v(x) on true;
+ string4 | count | x
+---------+-------+---
+ AAAAxx | 2500 | 1
+ HHHHxx | 2500 | 1
+ OOOOxx | 2500 | 1
+ VVVVxx | 2500 | 1
+ AAAAxx | 2500 | 2
+ HHHHxx | 2500 | 2
+ OOOOxx | 2500 | 2
+ VVVVxx | 2500 | 2
+ AAAAxx | 2500 | 3
+ HHHHxx | 2500 | 3
+ OOOOxx | 2500 | 3
+ VVVVxx | 2500 | 3
+(12 rows)
+
+reset enable_material;
reset enable_hashagg;
-- gather merge test with a LIMIT
explain (costs off)
diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql
index c0debddbcd1..cefb5a27d4d 100644
--- a/src/test/regress/sql/select_parallel.sql
+++ b/src/test/regress/sql/select_parallel.sql
@@ -118,6 +118,22 @@ explain (costs off)
select count(*) from tenk1 group by twenty;
+--test rescan behavior of gather merge
+set enable_material = false;
+
+explain (costs off)
+select * from
+ (select string4, count(unique2)
+ from tenk1 group by string4 order by string4) ss
+ right join (values (1),(2),(3)) v(x) on true;
+
+select * from
+ (select string4, count(unique2)
+ from tenk1 group by string4 order by string4) ss
+ right join (values (1),(2),(3)) v(x) on true;
+
+reset enable_material;
+
reset enable_hashagg;
-- gather merge test with a LIMIT