diff options
Diffstat (limited to 'src/backend/optimizer/path/joinpath.c')
-rw-r--r-- | src/backend/optimizer/path/joinpath.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index 5ef54c9caa9..9cc28d48717 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -620,10 +620,10 @@ sort_inner_and_outer(PlannerInfo *root, outerkeys = all_pathkeys; /* no work at first one... */ /* Sort the mergeclauses into the corresponding ordering */ - cur_mergeclauses = find_mergeclauses_for_pathkeys(root, - outerkeys, - true, - extra->mergeclause_list); + cur_mergeclauses = + find_mergeclauses_for_outer_pathkeys(root, + outerkeys, + extra->mergeclause_list); /* Should have used them all... */ Assert(list_length(cur_mergeclauses) == list_length(extra->mergeclause_list)); @@ -868,10 +868,10 @@ match_unsorted_outer(PlannerInfo *root, continue; /* Look for useful mergeclauses (if any) */ - mergeclauses = find_mergeclauses_for_pathkeys(root, - outerpath->pathkeys, - true, - extra->mergeclause_list); + mergeclauses = + find_mergeclauses_for_outer_pathkeys(root, + outerpath->pathkeys, + extra->mergeclause_list); /* * Done with this outer path if no chance for a mergejoin. @@ -991,10 +991,9 @@ match_unsorted_outer(PlannerInfo *root, if (sortkeycnt < num_sortkeys) { newclauses = - find_mergeclauses_for_pathkeys(root, - trialsortkeys, - false, - mergeclauses); + trim_mergeclauses_for_inner_pathkeys(root, + mergeclauses, + trialsortkeys); Assert(newclauses != NIL); } else @@ -1033,10 +1032,9 @@ match_unsorted_outer(PlannerInfo *root, if (sortkeycnt < num_sortkeys) { newclauses = - find_mergeclauses_for_pathkeys(root, - trialsortkeys, - false, - mergeclauses); + trim_mergeclauses_for_inner_pathkeys(root, + mergeclauses, + trialsortkeys); Assert(newclauses != NIL); } else |