diff options
Diffstat (limited to 'src/backend/optimizer/util/placeholder.c')
-rw-r--r-- | src/backend/optimizer/util/placeholder.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/backend/optimizer/util/placeholder.c b/src/backend/optimizer/util/placeholder.c index 44a41e3e9b8..93f1c2cdfa4 100644 --- a/src/backend/optimizer/util/placeholder.c +++ b/src/backend/optimizer/util/placeholder.c @@ -104,41 +104,28 @@ find_placeholder_info(PlannerInfo *root, PlaceHolderVar *phv, } /* - * find_placeholders_in_query - * Search the query for PlaceHolderVars, and build PlaceHolderInfos + * find_placeholders_in_jointree + * Search the jointree for PlaceHolderVars, and build PlaceHolderInfos * - * We need to examine the jointree, but not the targetlist, because - * build_base_rel_tlists() will already have made entries for any PHVs - * in the targetlist. - * - * We also need to search for PHVs in AppendRelInfo translated_vars - * lists. In most cases, translated_vars entries aren't directly referenced - * elsewhere, but we need to create PlaceHolderInfo entries for them to - * support set_rel_width() calculations for the appendrel child relations. + * We don't need to look at the targetlist because build_base_rel_tlists() + * will already have made entries for any PHVs in the tlist. */ void -find_placeholders_in_query(PlannerInfo *root) +find_placeholders_in_jointree(PlannerInfo *root) { /* We need do nothing if the query contains no PlaceHolderVars */ if (root->glob->lastPHId != 0) { - /* Recursively search the jointree */ + /* Start recursion at top of jointree */ Assert(root->parse->jointree != NULL && IsA(root->parse->jointree, FromExpr)); (void) find_placeholders_recurse(root, (Node *) root->parse->jointree); - - /* - * Also search the append_rel_list for translated vars that are PHVs. - * Barring finding them elsewhere in the query, they do not need any - * ph_may_need bits, only to be present in the PlaceHolderInfo list. - */ - mark_placeholders_in_expr(root, (Node *) root->append_rel_list, NULL); } } /* * find_placeholders_recurse - * One recursion level of jointree search for find_placeholders_in_query. + * One recursion level of find_placeholders_in_jointree. * * jtnode is the current jointree node to examine. * |