summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/pathnode.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2021-08-08 16:55:51 +0200
committerPeter Eisentraut <peter@eisentraut.org>2021-08-08 18:46:34 +0200
commit18fea737b5e47cc677eaf97365c765a47f346763 (patch)
tree4fd080fd87748c9f8505ff048cf36d67a1028f33 /src/backend/optimizer/util/pathnode.c
parent2226b4189bb4ccfcc53917a8695d24e91ff2f950 (diff)
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
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r--src/backend/optimizer/util/pathnode.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 41cbf328c46..a53850b3702 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -2443,10 +2443,10 @@ create_nestloop_path(PlannerInfo *root,
restrict_clauses = jclauses;
}
- pathnode->path.pathtype = T_NestLoop;
- pathnode->path.parent = joinrel;
- pathnode->path.pathtarget = joinrel->reltarget;
- pathnode->path.param_info =
+ pathnode->jpath.path.pathtype = T_NestLoop;
+ pathnode->jpath.path.parent = joinrel;
+ pathnode->jpath.path.pathtarget = joinrel->reltarget;
+ pathnode->jpath.path.param_info =
get_joinrel_parampathinfo(root,
joinrel,
outer_path,
@@ -2454,17 +2454,17 @@ create_nestloop_path(PlannerInfo *root,
extra->sjinfo,
required_outer,
&restrict_clauses);
- pathnode->path.parallel_aware = false;
- pathnode->path.parallel_safe = joinrel->consider_parallel &&
+ pathnode->jpath.path.parallel_aware = false;
+ pathnode->jpath.path.parallel_safe = joinrel->consider_parallel &&
outer_path->parallel_safe && inner_path->parallel_safe;
/* This is a foolish way to estimate parallel_workers, but for now... */
- pathnode->path.parallel_workers = outer_path->parallel_workers;
- pathnode->path.pathkeys = pathkeys;
- pathnode->jointype = jointype;
- pathnode->inner_unique = extra->inner_unique;
- pathnode->outerjoinpath = outer_path;
- pathnode->innerjoinpath = inner_path;
- pathnode->joinrestrictinfo = restrict_clauses;
+ pathnode->jpath.path.parallel_workers = outer_path->parallel_workers;
+ pathnode->jpath.path.pathkeys = pathkeys;
+ pathnode->jpath.jointype = jointype;
+ pathnode->jpath.inner_unique = extra->inner_unique;
+ pathnode->jpath.outerjoinpath = outer_path;
+ pathnode->jpath.innerjoinpath = inner_path;
+ pathnode->jpath.joinrestrictinfo = restrict_clauses;
final_cost_nestloop(root, pathnode, workspace, extra);
@@ -4110,13 +4110,15 @@ do { \
case T_NestPath:
{
JoinPath *jpath;
+ NestPath *npath;
- FLAT_COPY_PATH(jpath, path, NestPath);
+ FLAT_COPY_PATH(npath, path, NestPath);
+ jpath = (JoinPath *) npath;
REPARAMETERIZE_CHILD_PATH(jpath->outerjoinpath);
REPARAMETERIZE_CHILD_PATH(jpath->innerjoinpath);
ADJUST_CHILD_ATTRS(jpath->joinrestrictinfo);
- new_path = (Path *) jpath;
+ new_path = (Path *) npath;
}
break;