From 31468d05d89d494de00156e66c3e57d6dff9c79f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 22 Oct 2008 20:17:52 +0000 Subject: 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. --- src/include/nodes/relation.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index b5eb00a7a67..4ce13f808a2 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.162 2008/10/21 20:42:53 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.163 2008/10/22 20:17:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1290,6 +1290,9 @@ typedef struct AppendRelInfo * The idea is to evaluate the expression at (only) the ph_eval_at join level, * then allow it to bubble up like a Var until the ph_needed join level. * ph_needed has the same definition as attr_needed for a regular Var. + * + * We create a PlaceHolderInfo only after determining that the PlaceHolderVar + * is actually referenced in the plan tree. */ typedef struct PlaceHolderInfo -- cgit v1.2.3