Skip to content

Commit

Permalink
Make new regression indpendent of max_parallel_workers_per_gather.
Browse files Browse the repository at this point in the history
The tests in e2f1eb0 ("Implement partition-wise
grouping/aggregation.") weren't independent of the server's
max_parallel_workers_per_gather setting.  I (Andres) find it useful to
locally run with that disabled, and the aforementioned patch broke
this.

Author: Jeevan Chalke
Discussion:
    https://postgr.es/m/[email protected]
    https://postgr.es/m/CAM2+6=UNWGKTgh9aOn4=SQ72HfFzbVFseh9=5N54bD6KB+D9OQ@mail.gmail.com
  • Loading branch information
anarazel committed Mar 26, 2018
1 parent 96b5eac commit 0976c4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/test/regress/expected/partition_aggregate.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
SET enable_partitionwise_aggregate TO true;
-- Enable partitionwise join, which by default is disabled.
SET enable_partitionwise_join TO true;
-- Disable parallel plans.
SET max_parallel_workers_per_gather TO 0;
--
-- Tests for list partitioned tables.
--
Expand Down Expand Up @@ -921,6 +923,8 @@ ALTER TABLE pagg_tab_ml_p3 ATTACH PARTITION pagg_tab_ml_p3_s1 FOR VALUES FROM (0
ALTER TABLE pagg_tab_ml ATTACH PARTITION pagg_tab_ml_p3 FOR VALUES FROM (20) TO (30);
INSERT INTO pagg_tab_ml SELECT i % 30, i % 10, to_char(i % 4, 'FM0000') FROM generate_series(0, 29999) i;
ANALYZE pagg_tab_ml;
-- For Parallel Append
SET max_parallel_workers_per_gather TO 2;
-- 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()
Expand Down Expand Up @@ -1146,7 +1150,6 @@ SELECT a, sum(b), count(*) FROM pagg_tab_ml GROUP BY a, b, c HAVING avg(b) > 7 O
(12 rows)

-- Parallelism within partitionwise aggregates
SET max_parallel_workers_per_gather TO 2;
SET min_parallel_table_scan_size TO '8kB';
SET parallel_setup_cost TO 0;
-- Full aggregation at level 1 as GROUP BY clause matches with PARTITION KEY
Expand Down
6 changes: 5 additions & 1 deletion src/test/regress/sql/partition_aggregate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
SET enable_partitionwise_aggregate TO true;
-- Enable partitionwise join, which by default is disabled.
SET enable_partitionwise_join TO true;
-- Disable parallel plans.
SET max_parallel_workers_per_gather TO 0;

--
-- Tests for list partitioned tables.
Expand Down Expand Up @@ -206,6 +208,9 @@ ALTER TABLE pagg_tab_ml ATTACH PARTITION pagg_tab_ml_p3 FOR VALUES FROM (20) TO
INSERT INTO pagg_tab_ml SELECT i % 30, i % 10, to_char(i % 4, 'FM0000') FROM generate_series(0, 29999) i;
ANALYZE pagg_tab_ml;

-- For Parallel Append
SET max_parallel_workers_per_gather TO 2;

-- 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()
Expand Down Expand Up @@ -238,7 +243,6 @@ SELECT a, sum(b), count(*) FROM pagg_tab_ml GROUP BY a, b, c HAVING avg(b) > 7 O

-- Parallelism within partitionwise aggregates

SET max_parallel_workers_per_gather TO 2;
SET min_parallel_table_scan_size TO '8kB';
SET parallel_setup_cost TO 0;

Expand Down

0 comments on commit 0976c4d

Please sign in to comment.