Change parallel aggregation to run without ANALYZE

The number of loops per subplan is not stable
in the parallel aggregation leading to that test
sometimes failing. This patch changes this query
to run EXPLAIN without ANALYZE.
This commit is contained in:
Sven Klemm 2019-04-03 20:32:51 +02:00 committed by Sven Klemm
parent 3075518351
commit 74908c3632
4 changed files with 26 additions and 28 deletions

View File

@ -190,23 +190,22 @@ SELECT histogram(i, 10, 100000, 5) FROM "test";
-- test constraint aware append with parallel aggregation
SET max_parallel_workers_per_gather = 1;
:PREFIX SELECT count(*) FROM "test" WHERE length(version()) > 0;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
Finalize Aggregate (actual rows=1 loops=1)
-> Gather (actual rows=2 loops=1)
EXPLAIN (costs off) SELECT count(*) FROM "test" WHERE length(version()) > 0;
QUERY PLAN
---------------------------------------------------------------------------
Finalize Aggregate
-> Gather
Workers Planned: 1
Workers Launched: 1
-> Partial Aggregate (actual rows=1 loops=2)
-> Result (actual rows=500000 loops=2)
-> Partial Aggregate
-> Result
One-Time Filter: (length(version()) > 0)
-> Custom Scan (ConstraintAwareAppend) (actual rows=500000 loops=2)
-> Custom Scan (ConstraintAwareAppend)
Hypertable: test
Chunks left after exclusion: 2
-> Append (actual rows=500000 loops=2)
-> Parallel Seq Scan on _hyper_1_1_chunk (actual rows=250000 loops=2)
-> Parallel Seq Scan on _hyper_1_2_chunk (actual rows=250000 loops=2)
(13 rows)
-> Append
-> Parallel Seq Scan on _hyper_1_1_chunk
-> Parallel Seq Scan on _hyper_1_2_chunk
(12 rows)
SELECT count(*) FROM "test" WHERE length(version()) > 0;
count

View File

@ -189,23 +189,22 @@ SELECT histogram(i, 10, 100000, 5) FROM "test";
-- test constraint aware append with parallel aggregation
SET max_parallel_workers_per_gather = 1;
:PREFIX SELECT count(*) FROM "test" WHERE length(version()) > 0;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
Finalize Aggregate (actual rows=1 loops=1)
-> Gather (actual rows=2 loops=1)
EXPLAIN (costs off) SELECT count(*) FROM "test" WHERE length(version()) > 0;
QUERY PLAN
---------------------------------------------------------------------------
Finalize Aggregate
-> Gather
Workers Planned: 1
Workers Launched: 1
-> Partial Aggregate (actual rows=1 loops=2)
-> Result (actual rows=500000 loops=2)
-> Partial Aggregate
-> Result
One-Time Filter: (length(version()) > 0)
-> Custom Scan (ConstraintAwareAppend) (actual rows=500000 loops=2)
-> Custom Scan (ConstraintAwareAppend)
Hypertable: test
Chunks left after exclusion: 2
-> Parallel Append (actual rows=500000 loops=2)
-> Parallel Seq Scan on _hyper_1_1_chunk (actual rows=250000 loops=2)
-> Parallel Seq Scan on _hyper_1_2_chunk (actual rows=500000 loops=1)
(13 rows)
-> Parallel Append
-> Parallel Seq Scan on _hyper_1_1_chunk
-> Parallel Seq Scan on _hyper_1_2_chunk
(12 rows)
SELECT count(*) FROM "test" WHERE length(version()) > 0;
count

View File

@ -189,7 +189,7 @@ SELECT histogram(i, 10, 100000, 5) FROM "test";
-- test constraint aware append with parallel aggregation
SET max_parallel_workers_per_gather = 1;
:PREFIX SELECT count(*) FROM "test" WHERE length(version()) > 0;
EXPLAIN (costs off) SELECT count(*) FROM "test" WHERE length(version()) > 0;
QUERY PLAN
---------------------------------------------------------------------------
Finalize Aggregate

View File

@ -61,7 +61,7 @@ SELECT histogram(i, 10, 100000, 5) FROM "test";
-- test constraint aware append with parallel aggregation
SET max_parallel_workers_per_gather = 1;
:PREFIX SELECT count(*) FROM "test" WHERE length(version()) > 0;
EXPLAIN (costs off) SELECT count(*) FROM "test" WHERE length(version()) > 0;
SELECT count(*) FROM "test" WHERE length(version()) > 0;
SET max_parallel_workers_per_gather = 4;