Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2fe6b2a

Browse files
committed
Force parallelism in partition_aggregate
Commit db0d67d tweaked sort costing, which however resulted in a couple plan changes in our regression tests. Most of the new plans were fine, but partition_aggregate were meant to test parallel plans and the new plans were serial. Fix that by lowering parallel_setup_cost to 0, which is enough to switch to the parallel plan again. Commit 1349d27 already made the plans parallel again, but do this anyway to keep the tests in sync with 15, to make backpatching simpler. Report and patch by David Rowley. Author: David Rowley Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/CAApHDvpVFgWzXdtUQkjyOPhNrNvumRi_=ftgS79KeAZ92tnHKQ@mail.gmail.com
1 parent 92e7b77 commit 2fe6b2a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/test/regress/expected/partition_aggregate.out

+2
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ INSERT INTO pagg_tab_ml SELECT i % 30, i % 10, to_char(i % 4, 'FM0000') FROM gen
942942
ANALYZE pagg_tab_ml;
943943
-- For Parallel Append
944944
SET max_parallel_workers_per_gather TO 2;
945+
SET parallel_setup_cost = 0;
945946
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
946947
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
947948
-- PARTITION KEY, but still we do not see a partial aggregation as array_agg()
@@ -1025,6 +1026,7 @@ SELECT a, sum(b), array_agg(distinct c), count(*) FROM pagg_tab_ml GROUP BY a HA
10251026
-> Seq Scan on pagg_tab_ml_p2_s2 pagg_tab_ml_3
10261027
(25 rows)
10271028

1029+
RESET parallel_setup_cost;
10281030
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
10291031
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
10301032
-- PARTITION KEY, thus we will have a partial aggregation for them.

src/test/regress/sql/partition_aggregate.sql

+3
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ ANALYZE pagg_tab_ml;
222222

223223
-- For Parallel Append
224224
SET max_parallel_workers_per_gather TO 2;
225+
SET parallel_setup_cost = 0;
225226

226227
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
227228
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
@@ -235,6 +236,8 @@ SELECT a, sum(b), array_agg(distinct c), count(*) FROM pagg_tab_ml GROUP BY a HA
235236
EXPLAIN (COSTS OFF)
236237
SELECT a, sum(b), array_agg(distinct c), count(*) FROM pagg_tab_ml GROUP BY a HAVING avg(b) < 3;
237238

239+
RESET parallel_setup_cost;
240+
238241
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
239242
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
240243
-- PARTITION KEY, thus we will have a partial aggregation for them.

0 commit comments

Comments
 (0)