Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitefff724

Browse files
committed
Enhancement. Buildfarm have detected curious unstability in the parallel_workers
test: EXPLAIN of Partial Aggregate sometimes showed 0 rows instead 1.It is a race: parallel workers ran when main process have read allunderlying tuples.Use explain without analyze to avoid such a problem. As I see, we don't loseanything important.
1 parent1b33907 commitefff724

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

‎expected/parallel_workers.out

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,53 +68,52 @@ WHERE q1.id = q2.id; -- Learning stage
6868

6969
-- XXX: Why grouping prediction isn't working here?
7070
SELECT str FROM expln('
71-
EXPLAIN (ANALYZE,COSTS OFF, TIMING OFF, SUMMARY OFF)
71+
EXPLAIN (COSTS OFF, TIMING OFF, SUMMARY OFF)
7272
SELECT count(*) FROM
7373
(SELECT id FROM t WHERE id % 100 = 0 GROUP BY (id)) AS q1,
7474
(SELECT max(id) AS id, payload FROM t
7575
WHERE id % 101 = 0 GROUP BY (payload)) AS q2
7676
WHERE q1.id = q2.id;') AS str
77-
WHERE str NOT LIKE '%Workers%' AND str NOT LIKE '%Sort Method%'
78-
AND str NOT LIKE '%Gather Merge%';
77+
WHERE str NOT LIKE '%Workers%';
7978
str
8079
--------------------------------------------------------------------------------------------------
81-
Aggregate (actual rows=1 loops=1)
80+
Aggregate
8281
AQO not used
83-
-> Merge Join (actual rows=0 loops=1)
82+
-> Merge Join
8483
AQO not used
8584
Merge Cond: (q2.id = t_1.id)
86-
-> Sort (actual rows=1 loops=1)
85+
-> Sort
8786
Sort Key: q2.id
88-
-> Subquery Scan on q2 (actual rows=1 loops=1)
87+
-> Subquery Scan on q2
8988
AQO not used
90-
-> Finalize GroupAggregate (actual rows=1 loops=1)
89+
-> Finalize GroupAggregate
9190
AQO not used
9291
Group Key: t.payload
92+
-> Gather Merge
9393
AQO not used
94-
-> Partial GroupAggregate (actual rows=1 loops=3)
94+
-> Partial GroupAggregate
9595
AQO not used
9696
Group Key: t.payload
97-
-> Sort (actual rows=330 loops=3)
97+
-> Sort
9898
AQO not used
9999
Sort Key: t.payload
100-
-> Parallel Seq Scan on t (actual rows=330 loops=3)
101-
AQO: rows=991, error=0%
100+
-> Parallel Seq Scan on t
101+
AQO: rows=991
102102
Filter: ((id % '101'::numeric) = '0'::numeric)
103-
Rows Removed by Filter: 33003
104-
-> Group (actual rows=1000 loops=1)
103+
-> Group
105104
AQO not used
106105
Group Key: t_1.id
106+
-> Gather Merge
107107
AQO not used
108-
-> Group (actual rows=333 loops=3)
108+
-> Group
109109
AQO not used
110110
Group Key: t_1.id
111-
-> Sort (actual rows=333 loops=3)
111+
-> Sort
112112
AQO not used
113113
Sort Key: t_1.id
114-
-> Parallel Seq Scan on t t_1 (actual rows=333 loops=3)
115-
AQO: rows=991, error=-1%
114+
-> Parallel Seq Scan on t t_1
115+
AQO: rows=991
116116
Filter: ((id % '100'::numeric) = '0'::numeric)
117-
Rows Removed by Filter: 33000
118117
Using aqo: true
119118
AQO mode: LEARN
120119
JOINS: 1

‎sql/parallel_workers.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ SELECT count(*) FROM
4343
WHEREq1.id=q2.id;-- Learning stage
4444
-- XXX: Why grouping prediction isn't working here?
4545
SELECT strFROM expln('
46-
EXPLAIN (ANALYZE,COSTS OFF, TIMING OFF, SUMMARY OFF)
46+
EXPLAIN (COSTS OFF, TIMING OFF, SUMMARY OFF)
4747
SELECT count(*) FROM
4848
(SELECT id FROM t WHERE id % 100 = 0 GROUP BY (id)) AS q1,
4949
(SELECT max(id) AS id, payload FROM t
5050
WHERE id % 101 = 0 GROUP BY (payload)) AS q2
5151
WHERE q1.id = q2.id;')AS str
52-
WHERE str NOTLIKE'%Workers%'AND str NOTLIKE'%Sort Method%'
53-
AND str NOTLIKE'%Gather Merge%';
52+
WHERE str NOTLIKE'%Workers%';
5453

5554
RESET parallel_tuple_cost;
5655
RESET parallel_setup_cost;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp