summaryrefslogtreecommitdiff
path: root/src/backend/executor/execQual.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-02-27 01:11:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-02-27 01:11:26 +0000
commitc7ff7663e47fc4e295700101912f2b7dd53c1f4b (patch)
tree13e987e4894faca0086b78568b08b79cf124e8a1 /src/backend/executor/execQual.c
parent4756ff3dca903dfc525d1c27fd00fad8ca328188 (diff)
downloadpostgresql-c7ff7663e47fc4e295700101912f2b7dd53c1f4b.tar.gz
Get rid of the separate EState for subplans, and just let them share the
parent query's EState. Now that there's a single flat rangetable for both the main plan and subplans, there's no need anymore for a separate EState, and removing it allows cleaning up some crufty code in nodeSubplan.c and nodeSubqueryscan.c. Should be a tad faster too, although any difference will probably be hard to measure. This is the last bit of subsidiary mop-up work from changing to a flat rangetable.
Diffstat (limited to 'src/backend/executor/execQual.c')
-rw-r--r--src/backend/executor/execQual.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 3c0536eb8a..234441c0f6 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.213 2007/02/06 17:35:20 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.214 2007/02/27 01:11:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3723,27 +3723,16 @@ ExecInitExpr(Expr *node, PlanState *parent)
break;
case T_SubPlan:
{
- /* Keep this in sync with ExecInitExprInitPlan, below */
SubPlan *subplan = (SubPlan *) node;
- SubPlanState *sstate = makeNode(SubPlanState);
-
- sstate->xprstate.evalfunc = (ExprStateEvalFunc) ExecSubPlan;
+ SubPlanState *sstate;
if (!parent)
elog(ERROR, "SubPlan found with no parent plan");
- /*
- * Here we just add the SubPlanState nodes to parent->subPlan.
- * The subplans will be initialized later.
- */
- parent->subPlan = lcons(sstate, parent->subPlan);
- sstate->sub_estate = NULL;
- sstate->planstate = NULL;
+ sstate = ExecInitSubPlan(subplan, parent);
- sstate->testexpr =
- ExecInitExpr((Expr *) subplan->testexpr, parent);
- sstate->args = (List *)
- ExecInitExpr((Expr *) subplan->args, parent);
+ /* Add SubPlanState nodes to parent->subPlan */
+ parent->subPlan = lcons(sstate, parent->subPlan);
state = (ExprState *) sstate;
}
@@ -4158,32 +4147,6 @@ ExecInitExpr(Expr *node, PlanState *parent)
}
/*
- * ExecInitExprInitPlan --- initialize a subplan expr that's being handled
- * as an InitPlan. This is identical to ExecInitExpr's handling of a regular
- * subplan expr, except we do NOT want to add the node to the parent's
- * subplan list.
- */
-SubPlanState *
-ExecInitExprInitPlan(SubPlan *node, PlanState *parent)
-{
- SubPlanState *sstate = makeNode(SubPlanState);
-
- if (!parent)
- elog(ERROR, "SubPlan found with no parent plan");
-
- /* The subplan's state will be initialized later */
- sstate->sub_estate = NULL;
- sstate->planstate = NULL;
-
- sstate->testexpr = ExecInitExpr((Expr *) node->testexpr, parent);
- sstate->args = (List *) ExecInitExpr((Expr *) node->args, parent);
-
- sstate->xprstate.expr = (Expr *) node;
-
- return sstate;
-}
-
-/*
* ExecPrepareExpr --- initialize for expression execution outside a normal
* Plan tree context.
*