summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2016-06-18 04:28:51 +0000
committerTom Lane2016-06-18 04:28:51 +0000
commit598aa194af2fb7f294ae4b029494a134a44be333 (patch)
tree642913f86b2f828e4f9137700f0c023570804b2b /src/test
parent7e81a18d49f2ffc3397bde2660b255b56d8a6d77 (diff)
Still another try at fixing scanjoin_target insertion into parallel plans.
The previous code neglected the fact that the scanjoin_target might carry sortgroupref labelings that we need to absorb. Instead, do create_projection_path() unconditionally, and tweak the path's cost estimate after the fact. (I'm now convinced that we ought to refactor the way we account for sometimes not needing a separate projection step, but right now is not the time for that sort of cleanup.) Problem identified by Amit Kapila, patch by me.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/select_parallel.out18
-rw-r--r--src/test/regress/sql/select_parallel.sql6
2 files changed, 22 insertions, 2 deletions
diff --git a/src/test/regress/expected/select_parallel.out b/src/test/regress/expected/select_parallel.out
index 3c906407df2..2286fafab39 100644
--- a/src/test/regress/expected/select_parallel.out
+++ b/src/test/regress/expected/select_parallel.out
@@ -6,9 +6,10 @@ create or replace function parallel_restricted(int) returns int as
-- Serializable isolation would disable parallel query, so explicitly use an
-- arbitrary other level.
begin isolation level repeatable read;
--- setup parallel test
+-- encourage use of parallel plans
set parallel_setup_cost=0;
set parallel_tuple_cost=0;
+set min_parallel_relation_size=0;
set max_parallel_workers_per_gather=4;
explain (costs off)
select count(*) from a_star;
@@ -71,6 +72,21 @@ select length(stringu1) from tenk1 group by length(stringu1);
6
(1 row)
+explain (costs off)
+ select stringu1, count(*) from tenk1 group by stringu1 order by stringu1;
+ QUERY PLAN
+----------------------------------------------------
+ Sort
+ Sort Key: stringu1
+ -> Finalize HashAggregate
+ Group Key: stringu1
+ -> Gather
+ Workers Planned: 4
+ -> Partial HashAggregate
+ Group Key: stringu1
+ -> Parallel Seq Scan on tenk1
+(9 rows)
+
-- test that parallel plan for aggregates is not selected when
-- target list contains parallel restricted clause.
explain (costs off)
diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql
index a8cd9933329..38d3166742c 100644
--- a/src/test/regress/sql/select_parallel.sql
+++ b/src/test/regress/sql/select_parallel.sql
@@ -9,9 +9,10 @@ create or replace function parallel_restricted(int) returns int as
-- arbitrary other level.
begin isolation level repeatable read;
--- setup parallel test
+-- encourage use of parallel plans
set parallel_setup_cost=0;
set parallel_tuple_cost=0;
+set min_parallel_relation_size=0;
set max_parallel_workers_per_gather=4;
explain (costs off)
@@ -29,6 +30,9 @@ explain (costs off)
select length(stringu1) from tenk1 group by length(stringu1);
select length(stringu1) from tenk1 group by length(stringu1);
+explain (costs off)
+ select stringu1, count(*) from tenk1 group by stringu1 order by stringu1;
+
-- test that parallel plan for aggregates is not selected when
-- target list contains parallel restricted clause.
explain (costs off)