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

Commit7e187a7

Browse files
author
Richard Guo
committed
Fix unstable test in select_parallel.sql
One test case added in22d946b verifies the plan of a non-parallelnestloop join. The planner's choice of join order is arbitrary, andslight variations in underlying statistics could result in a differentdisplayed plan. To stabilize the test result, here we enforce thejoin order using a lateral join.While here, modify the test case to verify that parallel nestloop joinis not generated if the inner path is not parallel-safe, which is whatwe wanted to test in22d946b.Reported-by: Alexander Lakhin as per buildfarmAuthor: Richard GuoDiscussion:https://postgr.es/m/7c09a439-e48d-5460-cfa0-a371b1a57066@gmail.com
1 parent2d8ef5e commit7e187a7

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

‎src/test/regress/expected/select_parallel.out

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ reset enable_nestloop;
656656
-- test parallel nestloop join path with materialization of the inner path
657657
alter table tenk2 set (parallel_workers = 0);
658658
explain (costs off)
659-
select * from tenk1 t1, tenk2 t2 where t1.two > t2.two;
659+
select * from tenk1 t1, tenk2 t2 where t1.two > t2.two;
660660
QUERY PLAN
661661
-------------------------------------------
662662
Gather
@@ -668,18 +668,23 @@ explain (costs off)
668668
-> Seq Scan on tenk2 t2
669669
(7 rows)
670670

671-
-- the joinrel is not parallel-safe due to the OFFSET clause in the subquery
671+
-- test that parallel nestloop join is not generated if the inner path is
672+
-- not parallel-safe
672673
explain (costs off)
673-
select * from tenk1 t1, (select * from tenk2 t2 offset 0) t2 where t1.two > t2.two;
674+
select * from tenk1 t1
675+
left join lateral
676+
(select t1.unique1 as x, * from tenk2 t2 order by 1) t2
677+
on true
678+
where t1.two > t2.two;
674679
QUERY PLAN
675680
-------------------------------------------
676681
Nested Loop
677-
Join Filter: (t1.two > t2.two)
678682
-> Gather
679683
Workers Planned: 4
680684
-> Parallel Seq Scan on tenk1 t1
681-
-> Materialize
682-
-> Seq Scan on tenk2 t2
685+
-> Subquery Scan on t2
686+
Filter: (t1.two > t2.two)
687+
-> Seq Scan on tenk2 t2_1
683688
(7 rows)
684689

685690
alter table tenk2 reset (parallel_workers);

‎src/test/regress/sql/select_parallel.sql

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,16 @@ reset enable_nestloop;
269269
-- test parallel nestloop join path with materialization of the inner path
270270
altertable tenk2set (parallel_workers=0);
271271
explain (costs off)
272-
select*from tenk1 t1, tenk2 t2wheret1.two>t2.two;
272+
select*from tenk1 t1, tenk2 t2wheret1.two>t2.two;
273273

274-
-- the joinrel is not parallel-safe due to the OFFSET clause in the subquery
274+
-- test that parallel nestloop join is not generated if the inner path is
275+
-- not parallel-safe
275276
explain (costs off)
276-
select*from tenk1 t1, (select*from tenk2 t2 offset0) t2wheret1.two>t2.two;
277+
select*from tenk1 t1
278+
left join lateral
279+
(selectt1.unique1as x,*from tenk2 t2order by1) t2
280+
on true
281+
wheret1.two>t2.two;
277282
altertable tenk2 reset (parallel_workers);
278283

279284
-- test gather merge

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp