diff options
| author | Robert Haas | 2016-07-01 15:43:19 +0000 |
|---|---|---|
| committer | Robert Haas | 2016-07-01 15:52:56 +0000 |
| commit | 5ce5e4a12ee7175cd3fc356d9d38307e1d715827 (patch) | |
| tree | 9725c67aa6e6c8099088b73570862b50d763bb34 /src/test | |
| parent | 0daeba0e927bfcb3d0ed9d510b84e555fc1e2741 (diff) | |
Set consider_parallel correctly for upper planner rels.
Commit 3fc6e2d7f5b652b417fa6937c34de2438d60fa9f introduced new "upper"
RelOptInfo structures but didn't set consider_parallel for them
correctly, a point I completely missed when reviewing it. Later,
commit e06a38965b3bcdaa881e7e06892d4d8ab6c2c980 made the situation
worse by doing it incorrectly for the grouping relation. Try to
straighten all of that out. Along the way, get rid of the annoying
wholePlanParallelSafe flag, which was only necessarily because of
the fact that upper planning stages didn't use paths at the time
that code was written.
The most important immediate impact of these changes is that
force_parallel_mode will provide useful test coverage in quite a few
more scenarios than it did previously, but it's also necessary
preparation for fixing some problems related to subqueries.
Patch by me, reviewed by Tom Lane.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/aggregates.out | 7 | ||||
| -rw-r--r-- | src/test/regress/sql/aggregates.sql | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out index fba9bb959cd..14646c6397c 100644 --- a/src/test/regress/expected/aggregates.out +++ b/src/test/regress/expected/aggregates.out @@ -575,6 +575,12 @@ select max(unique1) from tenk1 where unique1 > 42; 9999 (1 row) +-- the planner may choose a generic aggregate here if parallel query is +-- enabled, since that plan will be parallel safe and the "optimized" +-- plan, which has almost identical cost, will not be. we want to test +-- the optimized plan, so temporarily disable parallel query. +begin; +set local max_parallel_workers_per_gather = 0; explain (costs off) select max(unique1) from tenk1 where unique1 > 42000; QUERY PLAN @@ -592,6 +598,7 @@ select max(unique1) from tenk1 where unique1 > 42000; (1 row) +rollback; -- multi-column index (uses tenk1_thous_tenthous) explain (costs off) select max(tenthous) from tenk1 where thousand = 33; diff --git a/src/test/regress/sql/aggregates.sql b/src/test/regress/sql/aggregates.sql index d7600faf8fa..9983ff3a896 100644 --- a/src/test/regress/sql/aggregates.sql +++ b/src/test/regress/sql/aggregates.sql @@ -234,9 +234,17 @@ select max(unique1) from tenk1 where unique1 < 42; explain (costs off) select max(unique1) from tenk1 where unique1 > 42; select max(unique1) from tenk1 where unique1 > 42; + +-- the planner may choose a generic aggregate here if parallel query is +-- enabled, since that plan will be parallel safe and the "optimized" +-- plan, which has almost identical cost, will not be. we want to test +-- the optimized plan, so temporarily disable parallel query. +begin; +set local max_parallel_workers_per_gather = 0; explain (costs off) select max(unique1) from tenk1 where unique1 > 42000; select max(unique1) from tenk1 where unique1 > 42000; +rollback; -- multi-column index (uses tenk1_thous_tenthous) explain (costs off) |
