summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vondra2022-09-04 22:09:17 +0000
committerTomas Vondra2022-09-04 22:09:17 +0000
commit2fe6b2a806f20f2dbf02c6e79783dbc2777a1840 (patch)
tree22e2469358d884a748c79646be61b77d0bc42e4e /src
parent92e7b7722da98eb4d54df7d4f850eee6a5fe9eef (diff)
Force parallelism in partition_aggregate
Commit db0d67db2 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 1349d2790 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
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/partition_aggregate.out2
-rw-r--r--src/test/regress/sql/partition_aggregate.sql3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/test/regress/expected/partition_aggregate.out b/src/test/regress/expected/partition_aggregate.out
index 4b41ccf1aa8..db36e3a150a 100644
--- a/src/test/regress/expected/partition_aggregate.out
+++ b/src/test/regress/expected/partition_aggregate.out
@@ -942,6 +942,7 @@ INSERT INTO pagg_tab_ml SELECT i % 30, i % 10, to_char(i % 4, 'FM0000') FROM gen
ANALYZE pagg_tab_ml;
-- For Parallel Append
SET max_parallel_workers_per_gather TO 2;
+SET parallel_setup_cost = 0;
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
-- 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
-> Seq Scan on pagg_tab_ml_p2_s2 pagg_tab_ml_3
(25 rows)
+RESET parallel_setup_cost;
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
-- PARTITION KEY, thus we will have a partial aggregation for them.
diff --git a/src/test/regress/sql/partition_aggregate.sql b/src/test/regress/sql/partition_aggregate.sql
index c17294b15b0..ab070fee244 100644
--- a/src/test/regress/sql/partition_aggregate.sql
+++ b/src/test/regress/sql/partition_aggregate.sql
@@ -222,6 +222,7 @@ ANALYZE pagg_tab_ml;
-- For Parallel Append
SET max_parallel_workers_per_gather TO 2;
+SET parallel_setup_cost = 0;
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
-- 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
EXPLAIN (COSTS OFF)
SELECT a, sum(b), array_agg(distinct c), count(*) FROM pagg_tab_ml GROUP BY a HAVING avg(b) < 3;
+RESET parallel_setup_cost;
+
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
-- for level 1 only. For subpartitions, GROUP BY clause does not match with
-- PARTITION KEY, thus we will have a partial aggregation for them.