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

Commitd8e34fa

Browse files
committed
Fix incorrect is-this-the-topmost-join tests in parallel planning.
Two callers of generate_useful_gather_paths were testing the wrongthing when deciding whether to call that function: they checked forbeing at the top of the current join subproblem, rather than being atthe actual top join. This'd result in failing to construct parallelpaths for a sub-join for which they might be useful.While set_rel_pathlist() isn't actively broken, it seems best tomake its identical-in-intention test for this be like the other two.This has been wrong all along, but given the lack of field complaintsI'm hesitant to back-patch into stable branches; we usually preferto avoid non-bug-fix changes in plan choices in minor releases.It seems not too late for v15 though.Richard Guo, reviewed by Antonin Houska and Tom LaneDiscussion:https://postgr.es/m/CAMbWs4-mH8Zf87-w+3P2J=nJB+5OyicO28ia9q_9o=Lamf_VHg@mail.gmail.com
1 parentd10fad9 commitd8e34fa

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/backend/optimizer/geqo/geqo_eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ merge_clump(PlannerInfo *root, List *clumps, Clump *new_clump, int num_gene,
273273
* rel once we know the final targetlist (see
274274
* grouping_planner).
275275
*/
276-
if (old_clump->size+new_clump->size<num_gene)
276+
if (!bms_equal(joinrel->relids,root->all_baserels))
277277
generate_useful_gather_paths(root,joinrel, false);
278278

279279
/* Find and save the cheapest paths for this joinrel */

‎src/backend/optimizer/path/allpaths.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,11 @@ set_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
554554
* its own pool of workers. Instead, we'll consider gathering partial
555555
* paths for the parent appendrel.
556556
*
557-
* Also, if this is the topmost scan/join rel (that is, the only baserel),
558-
* we postpone gathering until the final scan/join targetlist is available
559-
* (see grouping_planner).
557+
* Also, if this is the topmost scan/join rel, we postpone gathering until
558+
* the final scan/join targetlist is available (see grouping_planner).
560559
*/
561560
if (rel->reloptkind==RELOPT_BASEREL&&
562-
bms_membership(root->all_baserels)!=BMS_SINGLETON)
561+
!bms_equal(rel->relids,root->all_baserels))
563562
generate_useful_gather_paths(root,rel, false);
564563

565564
/* Now find the cheapest of the paths for this rel */
@@ -3435,7 +3434,7 @@ standard_join_search(PlannerInfo *root, int levels_needed, List *initial_rels)
34353434
* partial paths. We'll do the same for the topmost scan/join rel
34363435
* once we know the final targetlist (see grouping_planner).
34373436
*/
3438-
if (lev<levels_needed)
3437+
if (!bms_equal(rel->relids,root->all_baserels))
34393438
generate_useful_gather_paths(root,rel, false);
34403439

34413440
/* Find and save the cheapest paths for this rel */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp