1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-28 18:48:04 +03:00

Change NestPath node to contain JoinPath node

This makes the structure of all JoinPath-derived nodes the same,
independent of whether they have additional fields.

Discussion: https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce@enterprisedb.com
This commit is contained in:
Peter Eisentraut
2021-08-08 16:55:51 +02:00
parent 2226b4189b
commit 18fea737b5
4 changed files with 51 additions and 45 deletions

View File

@@ -4221,8 +4221,8 @@ create_nestloop_plan(PlannerInfo *root,
NestLoop *join_plan;
Plan *outer_plan;
Plan *inner_plan;
List *tlist = build_path_tlist(root, &best_path->path);
List *joinrestrictclauses = best_path->joinrestrictinfo;
List *tlist = build_path_tlist(root, &best_path->jpath.path);
List *joinrestrictclauses = best_path->jpath.joinrestrictinfo;
List *joinclauses;
List *otherclauses;
Relids outerrelids;
@@ -4230,13 +4230,13 @@ create_nestloop_plan(PlannerInfo *root,
Relids saveOuterRels = root->curOuterRels;
/* NestLoop can project, so no need to be picky about child tlists */
outer_plan = create_plan_recurse(root, best_path->outerjoinpath, 0);
outer_plan = create_plan_recurse(root, best_path->jpath.outerjoinpath, 0);
/* For a nestloop, include outer relids in curOuterRels for inner side */
root->curOuterRels = bms_union(root->curOuterRels,
best_path->outerjoinpath->parent->relids);
best_path->jpath.outerjoinpath->parent->relids);
inner_plan = create_plan_recurse(root, best_path->innerjoinpath, 0);
inner_plan = create_plan_recurse(root, best_path->jpath.innerjoinpath, 0);
/* Restore curOuterRels */
bms_free(root->curOuterRels);
@@ -4247,10 +4247,10 @@ create_nestloop_plan(PlannerInfo *root,
/* Get the join qual clauses (in plain expression form) */
/* Any pseudoconstant clauses are ignored here */
if (IS_OUTER_JOIN(best_path->jointype))
if (IS_OUTER_JOIN(best_path->jpath.jointype))
{
extract_actual_join_clauses(joinrestrictclauses,
best_path->path.parent->relids,
best_path->jpath.path.parent->relids,
&joinclauses, &otherclauses);
}
else
@@ -4261,7 +4261,7 @@ create_nestloop_plan(PlannerInfo *root,
}
/* Replace any outer-relation variables with nestloop params */
if (best_path->path.param_info)
if (best_path->jpath.path.param_info)
{
joinclauses = (List *)
replace_nestloop_params(root, (Node *) joinclauses);
@@ -4273,7 +4273,7 @@ create_nestloop_plan(PlannerInfo *root,
* Identify any nestloop parameters that should be supplied by this join
* node, and remove them from root->curOuterParams.
*/
outerrelids = best_path->outerjoinpath->parent->relids;
outerrelids = best_path->jpath.outerjoinpath->parent->relids;
nestParams = identify_current_nestloop_params(root, outerrelids);
join_plan = make_nestloop(tlist,
@@ -4282,10 +4282,10 @@ create_nestloop_plan(PlannerInfo *root,
nestParams,
outer_plan,
inner_plan,
best_path->jointype,
best_path->inner_unique);
best_path->jpath.jointype,
best_path->jpath.inner_unique);
copy_generic_path_info(&join_plan->join.plan, &best_path->path);
copy_generic_path_info(&join_plan->join.plan, &best_path->jpath.path);
return join_plan;
}