99 *
1010 *
1111 * IDENTIFICATION
12- * $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.133 2007/02/23 21:59:44 tgl Exp $
12+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/setrefs.c,v 1.134 2007/04/06 22:57:20 tgl Exp $
1313 *
1414 *-------------------------------------------------------------------------
1515 */
@@ -156,7 +156,8 @@ set_plan_references(PlannerGlobal *glob, Plan *plan, List *rtable)
156156/*
157157 * In the flat rangetable, we zero out substructure pointers that are
158158 * not needed by the executor; this reduces the storage space and
159- * copying cost for cached plans.
159+ * copying cost for cached plans. We keep only the alias and eref
160+ * Alias fields, which are needed by EXPLAIN.
160161 */
161162foreach (lc ,rtable )
162163{
@@ -167,14 +168,13 @@ set_plan_references(PlannerGlobal *glob, Plan *plan, List *rtable)
167168newrte = (RangeTblEntry * )palloc (sizeof (RangeTblEntry ));
168169memcpy (newrte ,rte ,sizeof (RangeTblEntry ));
169170
170- /* zap unneeded sub-structure(we keep only the eref Alias) */
171+ /* zap unneeded sub-structure */
171172newrte -> subquery = NULL ;
172173newrte -> funcexpr = NULL ;
173174newrte -> funccoltypes = NIL ;
174175newrte -> funccoltypmods = NIL ;
175176newrte -> values_lists = NIL ;
176177newrte -> joinaliasvars = NIL ;
177- newrte -> alias = NULL ;
178178
179179glob -> finalrtable = lappend (glob -> finalrtable ,newrte );
180180}