mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +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:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.116 2008/10/21 20:42:53 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.117 2008/10/22 20:17:52 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -298,19 +298,10 @@ OffsetVarNodes_walker(Node *node, OffsetVarNodes_context *context)
|
||||
}
|
||||
/* fall through to examine children */
|
||||
}
|
||||
if (IsA(node, PlaceHolderInfo))
|
||||
{
|
||||
PlaceHolderInfo *phinfo = (PlaceHolderInfo *) node;
|
||||
/* Shouldn't need to handle other planner auxiliary nodes here */
|
||||
Assert(!IsA(node, SpecialJoinInfo));
|
||||
Assert(!IsA(node, PlaceHolderInfo));
|
||||
|
||||
if (context->sublevels_up == 0)
|
||||
{
|
||||
phinfo->ph_eval_at = offset_relid_set(phinfo->ph_eval_at,
|
||||
context->offset);
|
||||
phinfo->ph_needed = offset_relid_set(phinfo->ph_needed,
|
||||
context->offset);
|
||||
}
|
||||
/* fall through to examine children */
|
||||
}
|
||||
if (IsA(node, Query))
|
||||
{
|
||||
/* Recurse into subselects */
|
||||
@@ -489,21 +480,10 @@ ChangeVarNodes_walker(Node *node, ChangeVarNodes_context *context)
|
||||
}
|
||||
/* fall through to examine children */
|
||||
}
|
||||
if (IsA(node, PlaceHolderInfo))
|
||||
{
|
||||
PlaceHolderInfo *phinfo = (PlaceHolderInfo *) node;
|
||||
/* Shouldn't need to handle other planner auxiliary nodes here */
|
||||
Assert(!IsA(node, SpecialJoinInfo));
|
||||
Assert(!IsA(node, PlaceHolderInfo));
|
||||
|
||||
if (context->sublevels_up == 0)
|
||||
{
|
||||
phinfo->ph_eval_at = adjust_relid_set(phinfo->ph_eval_at,
|
||||
context->rt_index,
|
||||
context->new_index);
|
||||
phinfo->ph_needed = adjust_relid_set(phinfo->ph_needed,
|
||||
context->rt_index,
|
||||
context->new_index);
|
||||
}
|
||||
/* fall through to examine children */
|
||||
}
|
||||
if (IsA(node, Query))
|
||||
{
|
||||
/* Recurse into subselects */
|
||||
|
Reference in New Issue
Block a user