@@ -152,7 +152,8 @@ pathman_join_pathlist_hook(PlannerInfo *root,
152
152
Relids required_nestloop ,
153
153
required_inner ;
154
154
List * filtered_joinclauses = NIL ,
155
- * saved_ppi_list ;
155
+ * saved_ppi_list ,
156
+ * pathkeys ;
156
157
ListCell * rinfo_lc ;
157
158
158
159
if (!IsA (cur_inner_path , AppendPath ))
@@ -217,17 +218,18 @@ pathman_join_pathlist_hook(PlannerInfo *root,
217
218
return ;
218
219
219
220
221
+ /* TODO: create macro initial_cost_nestloop_compat() */
222
+ #if defined(PGPRO_VERSION ) && PG_VERSION_NUM >= 90603
223
+ initial_cost_nestloop (root , & workspace , jointype ,
224
+ outer , inner , /* built paths */
225
+ extra );
226
+ #else
220
227
initial_cost_nestloop (root , & workspace , jointype ,
221
228
outer , inner , /* built paths */
222
229
extra -> sjinfo , & extra -> semifactors );
230
+ #endif
223
231
224
- nest_path = create_nestloop_path (root , joinrel , jointype , & workspace ,
225
- extra -> sjinfo , & extra -> semifactors ,
226
- outer , inner , extra -> restrictlist ,
227
- build_join_pathkeys (root , joinrel ,
228
- jointype ,
229
- outer -> pathkeys ),
230
- required_nestloop );
232
+ pathkeys = build_join_pathkeys (root , joinrel , jointype , outer -> pathkeys );
231
233
232
234
/* Discard all clauses that are to be evaluated by 'inner' */
233
235
foreach (rinfo_lc , extra -> restrictlist )
@@ -239,6 +241,24 @@ pathman_join_pathlist_hook(PlannerInfo *root,
239
241
filtered_joinclauses = lappend (filtered_joinclauses , rinfo );
240
242
}
241
243
244
+ /* TODO: create macro create_nestloop_path_compat() */
245
+ #if defined(PGPRO_VERSION ) && PG_VERSION_NUM >= 90603
246
+ nest_path = create_nestloop_path (root , joinrel , jointype , & workspace ,
247
+ extra ,
248
+ outer , inner ,
249
+ filtered_joinclauses ,
250
+ pathkeys ,
251
+ calc_nestloop_required_outer (outer , inner ));
252
+ #else
253
+ nest_path = create_nestloop_path (root , joinrel , jointype , & workspace ,
254
+ extra -> sjinfo ,
255
+ & extra -> semifactors ,
256
+ outer , inner ,
257
+ filtered_joinclauses ,
258
+ pathkeys ,
259
+ calc_nestloop_required_outer (outer , inner ));
260
+ #endif
261
+
242
262
/*
243
263
* NOTE: Override 'rows' value produced by standard estimator.
244
264
* Currently we use get_parameterized_joinrel_size() since
0 commit comments