Skip to content

Commit a3e77da

Browse files
committed
Add little optimization
1 parent 6c30c32 commit a3e77da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/hooks.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ pathman_join_pathlist_hook(PlannerInfo *root,
130130
}
131131

132132
/* Make copy of partitioning expression and fix Var's varno attributes */
133-
expr = copyObject(inner_prel->expr);
133+
expr = inner_prel->expr;
134134
if (innerrel->relid != 1)
135+
{
136+
expr = copyObject(expr);
135137
ChangeVarNodes(expr, 1, innerrel->relid, 0);
138+
}
136139

137140
paramsel = 1.0;
138141
foreach (lc, joinclauses)
@@ -206,8 +209,6 @@ pathman_join_pathlist_hook(PlannerInfo *root,
206209
required_nestloop = calc_nestloop_required_outer(outer, inner);
207210

208211
/*
209-
* Check to see if proposed path is still parameterized, and reject if the
210-
* parameterization wouldn't be sensible --- unless allow_star_schema_join
211212
* says to allow it anyway. Also, we must reject if have_dangerous_phv
212213
* doesn't like the look of it, which could only happen if the nestloop is
213214
* still parameterized.

0 commit comments

Comments
 (0)