@@ -185,7 +185,7 @@ create_pickyappend_path(PlannerInfo *root,
185185ParamPathInfo * param_info ,
186186JoinPathExtraData * extra )
187187{
188- AppendPath * inner_append = (AppendPath * )innerrel -> cheapest_total_path ;
188+ AppendPath * inner_append = (AppendPath * )linitial ( innerrel -> cheapest_parameterized_paths ) ;
189189List * joinrestrictclauses = extra -> restrictlist ;
190190List * joinclauses ;
191191List * otherclauses ;
@@ -282,7 +282,7 @@ pathman_join_pathlist_hook(PlannerInfo *root,
282282
283283if (innerrel -> reloptkind == RELOPT_BASEREL &&
284284inner_entry -> inh &&
285- IsA (innerrel -> cheapest_total_path ,AppendPath )&&
285+ IsA (linitial ( innerrel -> cheapest_parameterized_paths ) ,AppendPath )&&
286286(inner_prel = get_pathman_relation_info (inner_entry -> relid ,NULL )))
287287{
288288elog (LOG ,"adding new nestloop path with pickyappend" );
@@ -291,7 +291,7 @@ pathman_join_pathlist_hook(PlannerInfo *root,
291291
292292outer = outerrel -> cheapest_total_path ;
293293
294- inner_required = bms_union (PATH_REQ_OUTER (innerrel -> cheapest_total_path ),
294+ inner_required = bms_union (PATH_REQ_OUTER (( Path * ) linitial ( innerrel -> cheapest_parameterized_paths ) ),
295295bms_make_singleton (outerrel -> relid ));
296296
297297inner = create_pickyappend_path (root ,joinrel ,outerrel ,innerrel ,