mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Dept of better ideas: refrain from creating the planner's placeholder_list
until vars are distributed to rels during query_planner() startup. We don't really need it before that, and not building it early has some advantages. First, we don't need to put it through the various preprocessing steps, which saves some cycles and eliminates the need for a number of routines to support PlaceHolderInfo nodes at all. Second, this means one less unused plan for any sub-SELECT appearing in a placeholder's expression, since we don't build placeholder_list until after sublink expansion is complete.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.159 2008/10/21 20:42:53 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.160 2008/10/22 20:17:52 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1599,26 +1599,10 @@ adjust_appendrel_attrs_mutator(Node *node, AppendRelInfo *context)
|
||||
context->child_relid);
|
||||
return (Node *) phv;
|
||||
}
|
||||
if (IsA(node, PlaceHolderInfo))
|
||||
{
|
||||
/* Copy the PlaceHolderInfo node with correct mutation of subnodes */
|
||||
PlaceHolderInfo *phinfo;
|
||||
|
||||
phinfo = (PlaceHolderInfo *) expression_tree_mutator(node,
|
||||
adjust_appendrel_attrs_mutator,
|
||||
(void *) context);
|
||||
/* now fix PlaceHolderInfo's relid sets */
|
||||
phinfo->ph_eval_at = adjust_relid_set(phinfo->ph_eval_at,
|
||||
context->parent_relid,
|
||||
context->child_relid);
|
||||
phinfo->ph_needed = adjust_relid_set(phinfo->ph_needed,
|
||||
context->parent_relid,
|
||||
context->child_relid);
|
||||
return (Node *) phinfo;
|
||||
}
|
||||
/* Shouldn't need to handle other planner auxiliary nodes here */
|
||||
/* Shouldn't need to handle planner auxiliary nodes here */
|
||||
Assert(!IsA(node, SpecialJoinInfo));
|
||||
Assert(!IsA(node, AppendRelInfo));
|
||||
Assert(!IsA(node, PlaceHolderInfo));
|
||||
|
||||
/*
|
||||
* We have to process RestrictInfo nodes specially.
|
||||
|
||||
Reference in New Issue
Block a user