diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-27 01:11:26 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-27 01:11:26 +0000 |
commit | c7ff7663e47fc4e295700101912f2b7dd53c1f4b (patch) | |
tree | 13e987e4894faca0086b78568b08b79cf124e8a1 /src/backend/executor/execProcnode.c | |
parent | 4756ff3dca903dfc525d1c27fd00fad8ca328188 (diff) | |
download | postgresql-c7ff7663e47fc4e295700101912f2b7dd53c1f4b.tar.gz postgresql-c7ff7663e47fc4e295700101912f2b7dd53c1f4b.zip |
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/execProcnode.c')
-rw-r--r-- | src/backend/executor/execProcnode.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c index 0a3539204a0..c4fbf9d3996 100644 --- a/src/backend/executor/execProcnode.c +++ b/src/backend/executor/execProcnode.c @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execProcnode.c,v 1.60 2007/01/05 22:19:27 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execProcnode.c,v 1.61 2007/02/27 01:11:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -278,26 +278,11 @@ ExecInitNode(Plan *node, EState *estate, int eflags) SubPlanState *sstate; Assert(IsA(subplan, SubPlan)); - sstate = ExecInitExprInitPlan(subplan, result); - ExecInitSubPlan(sstate, estate, eflags); + sstate = ExecInitSubPlan(subplan, result); subps = lappend(subps, sstate); } result->initPlan = subps; - /* - * Initialize any subPlans present in this node. These were found by - * ExecInitExpr during initialization of the PlanState. Note we must do - * this after initializing initPlans, in case their arguments contain - * subPlans (is that actually possible? perhaps not). - */ - foreach(l, result->subPlan) - { - SubPlanState *sstate = (SubPlanState *) lfirst(l); - - Assert(IsA(sstate, SubPlanState)); - ExecInitSubPlan(sstate, estate, eflags); - } - /* Set up instrumentation for this node if requested */ if (estate->es_instrument) result->instrument = InstrAlloc(1); @@ -610,20 +595,12 @@ ExecCountSlotsNode(Plan *node) void ExecEndNode(PlanState *node) { - ListCell *subp; - /* * do nothing when we get to the end of a leaf on tree. */ if (node == NULL) return; - /* Clean up initPlans and subPlans */ - foreach(subp, node->initPlan) - ExecEndSubPlan((SubPlanState *) lfirst(subp)); - foreach(subp, node->subPlan) - ExecEndSubPlan((SubPlanState *) lfirst(subp)); - if (node->chgParam != NULL) { bms_free(node->chgParam); |