summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/prepunion.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-10-22 20:17:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-10-22 20:17:52 +0000
commit31468d05d89d494de00156e66c3e57d6dff9c79f (patch)
tree2003474691158d0d9b87e9d1a06cb2f0f754e726 /src/backend/optimizer/prep/prepunion.c
parentb9856b67a7a762ab5bedfafbda4f654797d83996 (diff)
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.
Diffstat (limited to 'src/backend/optimizer/prep/prepunion.c')
-rw-r--r--src/backend/optimizer/prep/prepunion.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c
index 0efd150f6bf..dd7f2f28e0a 100644
--- a/src/backend/optimizer/prep/prepunion.c
+++ b/src/backend/optimizer/prep/prepunion.c
@@ -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.