Remove obsolete executor cleanup code
authorAmit Langote <amitlan@postgresql.org>
Thu, 28 Sep 2023 00:44:39 +0000 (09:44 +0900)
committerAmit Langote <amitlan@postgresql.org>
Thu, 28 Sep 2023 00:44:39 +0000 (09:44 +0900)
This commit removes unnecessary ExecExprFreeContext() calls in
ExecEnd* routines because the actual cleanup is managed by
FreeExecutorState(). With no callers remaining for
ExecExprFreeContext(), this commit also removes the function.

This commit also drops redundant ExecClearTuple() calls, because
ExecResetTupleTable() in ExecEndPlan() already takes care of
resetting and dropping all TupleTableSlots initialized with
ExecInitScanTupleSlot() and ExecInitExtraTupleSlot().

After these modifications, the ExecEnd*() routines for ValuesScan,
NamedTuplestoreScan, and WorkTableScan became redundant. So, this
commit removes them.

Reviewed-by: Robert Haas
Discussion: https://postgr.es/m/CA+HiwqFGkMSge6TgC9KQzde0ohpAycLQuV7ooitEEpbKB0O_mg@mail.gmail.com

42 files changed:
src/backend/executor/execProcnode.c
src/backend/executor/execUtils.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeBitmapIndexscan.c
src/backend/executor/nodeCtescan.c
src/backend/executor/nodeCustom.c
src/backend/executor/nodeForeignscan.c
src/backend/executor/nodeFunctionscan.c
src/backend/executor/nodeGather.c
src/backend/executor/nodeGatherMerge.c
src/backend/executor/nodeGroup.c
src/backend/executor/nodeHash.c
src/backend/executor/nodeHashjoin.c
src/backend/executor/nodeIncrementalSort.c
src/backend/executor/nodeIndexonlyscan.c
src/backend/executor/nodeIndexscan.c
src/backend/executor/nodeLimit.c
src/backend/executor/nodeMaterial.c
src/backend/executor/nodeMemoize.c
src/backend/executor/nodeMergejoin.c
src/backend/executor/nodeModifyTable.c
src/backend/executor/nodeNamedtuplestorescan.c
src/backend/executor/nodeNestloop.c
src/backend/executor/nodeProjectSet.c
src/backend/executor/nodeResult.c
src/backend/executor/nodeSamplescan.c
src/backend/executor/nodeSeqscan.c
src/backend/executor/nodeSetOp.c
src/backend/executor/nodeSort.c
src/backend/executor/nodeSubqueryscan.c
src/backend/executor/nodeTableFuncscan.c
src/backend/executor/nodeTidrangescan.c
src/backend/executor/nodeTidscan.c
src/backend/executor/nodeUnique.c
src/backend/executor/nodeValuesscan.c
src/backend/executor/nodeWindowAgg.c
src/backend/executor/nodeWorktablescan.c
src/include/executor/executor.h
src/include/executor/nodeNamedtuplestorescan.h
src/include/executor/nodeValuesscan.h
src/include/executor/nodeWorktablescan.h

index 4d288bc8d41f5038ade70d1bd1a0c57a8f88e037..b4b5c562c0f2ac7f15f9f304ce4dd27cc64f01e9 100644 (file)
@@ -667,22 +667,10 @@ ExecEndNode(PlanState *node)
            ExecEndTableFuncScan((TableFuncScanState *) node);
            break;
 
-       case T_ValuesScanState:
-           ExecEndValuesScan((ValuesScanState *) node);
-           break;
-
        case T_CteScanState:
            ExecEndCteScan((CteScanState *) node);
            break;
 
-       case T_NamedTuplestoreScanState:
-           ExecEndNamedTuplestoreScan((NamedTuplestoreScanState *) node);
-           break;
-
-       case T_WorkTableScanState:
-           ExecEndWorkTableScan((WorkTableScanState *) node);
-           break;
-
        case T_ForeignScanState:
            ExecEndForeignScan((ForeignScanState *) node);
            break;
@@ -757,6 +745,12 @@ ExecEndNode(PlanState *node)
            ExecEndLimit((LimitState *) node);
            break;
 
+           /* No clean up actions for these nodes. */
+       case T_ValuesScanState:
+       case T_NamedTuplestoreScanState:
+       case T_WorkTableScanState:
+           break;
+
        default:
            elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
            break;
index c06b22885833503e489ec4f09290066931d4bc71..16704c0c2f1838732b8c485da0a725d958aa7cee 100644 (file)
@@ -638,32 +638,6 @@ tlist_matches_tupdesc(PlanState *ps, List *tlist, int varno, TupleDesc tupdesc)
    return true;
 }
 
-/* ----------------
- *     ExecFreeExprContext
- *
- * A plan node's ExprContext should be freed explicitly during executor
- * shutdown because there may be shutdown callbacks to call.  (Other resources
- * made by the above routines, such as projection info, don't need to be freed
- * explicitly because they're just memory in the per-query memory context.)
- *
- * However ... there is no particular need to do it during ExecEndNode,
- * because FreeExecutorState will free any remaining ExprContexts within
- * the EState.  Letting FreeExecutorState do it allows the ExprContexts to
- * be freed in reverse order of creation, rather than order of creation as
- * will happen if we delete them here, which saves O(N^2) work in the list
- * cleanup inside FreeExprContext.
- * ----------------
- */
-void
-ExecFreeExprContext(PlanState *planstate)
-{
-   /*
-    * Per above discussion, don't actually delete the ExprContext. We do
-    * unlink it from the plan node, though.
-    */
-   planstate->ps_ExprContext = NULL;
-}
-
 
 /* ----------------------------------------------------------------
  *               Scan node support
index 468db94fe5ba07a19842aeb3a841ca956e5953af..f154f289028500cd1d60be22b54ad4a7f10efa1a 100644 (file)
@@ -4357,16 +4357,6 @@ ExecEndAgg(AggState *node)
    if (node->hashcontext)
        ReScanExprContext(node->hashcontext);
 
-   /*
-    * We don't actually free any ExprContexts here (see comment in
-    * ExecFreeExprContext), just unlinking the output one from the plan node
-    * suffices.
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /* clean up tuple table */
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    outerPlan = outerPlanState(node);
    ExecEndNode(outerPlan);
 }
index f35df0b8bfb472cc60fb06001380372b89f17e6f..2db0acfc76ac236fdc459b05feb93c7957a135ed 100644 (file)
@@ -655,18 +655,6 @@ ExecEndBitmapHeapScan(BitmapHeapScanState *node)
     */
    scanDesc = node->ss.ss_currentScanDesc;
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clear out tuple table slots
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * close down subplans
     */
index 83ec9ede899ec56341f566a52a49ed11f3d8d599..7cf8532bc959053d2c4e0c28b080a2136afb7646 100644 (file)
@@ -184,14 +184,6 @@ ExecEndBitmapIndexScan(BitmapIndexScanState *node)
    indexRelationDesc = node->biss_RelationDesc;
    indexScanDesc = node->biss_ScanDesc;
 
-   /*
-    * Free the exprcontext ... now dead code, see ExecFreeExprContext
-    */
-#ifdef NOT_USED
-   if (node->biss_RuntimeContext)
-       FreeExprContext(node->biss_RuntimeContext, true);
-#endif
-
    /*
     * close the index relation (no-op if we didn't open it)
     */
index cc4c4243e2fb5e7069d1e4bc11e53a16b1b0e602..a0c0c4be337d7629e13c2ee659a0b34f507af71a 100644 (file)
@@ -287,18 +287,6 @@ ExecInitCteScan(CteScan *node, EState *estate, int eflags)
 void
 ExecEndCteScan(CteScanState *node)
 {
-   /*
-    * Free exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * If I am the leader, free the tuplestore.
     */
index bd42c65b29385b676b1510939213fc13d3f70dda..28b5bb9353ab2862fb624e669a36d51cdeaaae6a 100644 (file)
@@ -129,13 +129,6 @@ ExecEndCustomScan(CustomScanState *node)
 {
    Assert(node->methods->EndCustomScan != NULL);
    node->methods->EndCustomScan(node);
-
-   /* Free the exprcontext */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /* Clean out the tuple table */
-   ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
 }
 
 void
index c2139acca075206c3861b11da398be36cf1419ff..73913ebb18423eee3016daa0696a8d6ea8d646c0 100644 (file)
@@ -312,14 +312,6 @@ ExecEndForeignScan(ForeignScanState *node)
    /* Shut down any outer plan. */
    if (outerPlanState(node))
        ExecEndNode(outerPlanState(node));
-
-   /* Free the exprcontext */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /* clean out the tuple table */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
 }
 
 /* ----------------------------------------------------------------
index dd06ef8aee868ec8eed628efaefeb20a5950e16b..2dddbcda14123e08b82ee17a24a2b617a4303fd8 100644 (file)
@@ -523,18 +523,6 @@ ExecEndFunctionScan(FunctionScanState *node)
 {
    int         i;
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * Release slots and tuplestore resources
     */
@@ -542,9 +530,6 @@ ExecEndFunctionScan(FunctionScanState *node)
    {
        FunctionScanPerFuncState *fs = &node->funcstates[i];
 
-       if (fs->func_slot)
-           ExecClearTuple(fs->func_slot);
-
        if (fs->tstore != NULL)
        {
            tuplestore_end(node->funcstates[i].tstore);
index 307fc10eea7bd6c95a7f6fc11232b465ca656964..bb2500a469041f3f9a87231cf0618280a35a1def 100644 (file)
@@ -250,9 +250,6 @@ ExecEndGather(GatherState *node)
 {
    ExecEndNode(outerPlanState(node));  /* let children clean up first */
    ExecShutdownGather(node);
-   ExecFreeExprContext(&node->ps);
-   if (node->ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ps.ps_ResultTupleSlot);
 }
 
 /*
index 9d5e1a46e9e2afd8982478dab7ab2ebabe462595..7a71a58509cb05cf6858f797b2e9f30398fc63f2 100644 (file)
@@ -290,9 +290,6 @@ ExecEndGatherMerge(GatherMergeState *node)
 {
    ExecEndNode(outerPlanState(node));  /* let children clean up first */
    ExecShutdownGatherMerge(node);
-   ExecFreeExprContext(&node->ps);
-   if (node->ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ps.ps_ResultTupleSlot);
 }
 
 /* ----------------------------------------------------------------
index 25a1618952e6bf83b90ddea763acfc1872bcb88e..8c650f0e46d588663fec59c89c4e74f327179daf 100644 (file)
@@ -228,11 +228,6 @@ ExecEndGroup(GroupState *node)
 {
    PlanState  *outerPlan;
 
-   ExecFreeExprContext(&node->ss.ps);
-
-   /* clean up tuple table */
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    outerPlan = outerPlanState(node);
    ExecEndNode(outerPlan);
 }
index 8b5c35b82b88461c2f61987d2265c1249961d87d..e72f0986c268f13a74a57b3e09bb8f42b2130d4e 100644 (file)
@@ -415,11 +415,6 @@ ExecEndHash(HashState *node)
 {
    PlanState  *outerPlan;
 
-   /*
-    * free exprcontext
-    */
-   ExecFreeExprContext(&node->ps);
-
    /*
     * shut down the subplan
     */
index 980746128bcbe7c917f14bdf936426b86de9f6fe..aea44a9d566aae918cf138a74f46a952b8a5aeb6 100644 (file)
@@ -867,18 +867,6 @@ ExecEndHashJoin(HashJoinState *node)
        node->hj_HashTable = NULL;
    }
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->js.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->js.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->hj_OuterTupleSlot);
-   ExecClearTuple(node->hj_HashTupleSlot);
-
    /*
     * clean up subtrees
     */
index 7683e3341cde9abbafa18cde1cba1f44a20b3903..cd094a190cb6ab808c8cbfbd03265587adac9c7f 100644 (file)
@@ -1079,11 +1079,6 @@ ExecEndIncrementalSort(IncrementalSortState *node)
 {
    SO_printf("ExecEndIncrementalSort: shutting down sort node\n");
 
-   /* clean out the scan tuple */
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-   /* must drop pointer to sort result tuple */
-   ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   /* must drop standalone tuple slots from outer node */
    ExecDropSingleTupleTableSlot(node->group_pivot);
    ExecDropSingleTupleTableSlot(node->transfer_tuple);
 
index 0b43a9b9699019a24af8739f9590bdf2933d9d9b..f1db35665c8bc03d339c30e749ac5674c99c8f45 100644 (file)
@@ -380,22 +380,6 @@ ExecEndIndexOnlyScan(IndexOnlyScanState *node)
        node->ioss_VMBuffer = InvalidBuffer;
    }
 
-   /*
-    * Free the exprcontext(s) ... now dead code, see ExecFreeExprContext
-    */
-#ifdef NOT_USED
-   ExecFreeExprContext(&node->ss.ps);
-   if (node->ioss_RuntimeContext)
-       FreeExprContext(node->ioss_RuntimeContext, true);
-#endif
-
-   /*
-    * clear out tuple table slots
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * close the index relation (no-op if we didn't open it)
     */
index 4540c7781d2d2064ef43dfb93971340045637a3c..14b9c00217a844f0d3bd13064eb8de0981aed258 100644 (file)
@@ -794,22 +794,6 @@ ExecEndIndexScan(IndexScanState *node)
    indexRelationDesc = node->iss_RelationDesc;
    indexScanDesc = node->iss_ScanDesc;
 
-   /*
-    * Free the exprcontext(s) ... now dead code, see ExecFreeExprContext
-    */
-#ifdef NOT_USED
-   ExecFreeExprContext(&node->ss.ps);
-   if (node->iss_RuntimeContext)
-       FreeExprContext(node->iss_RuntimeContext, true);
-#endif
-
-   /*
-    * clear out tuple table slots
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * close the index relation (no-op if we didn't open it)
     */
index 425fbfc405fda71df53572295ab557fcd2218d18..5654158e3e93793b5de9fa40447842630a36370c 100644 (file)
@@ -534,7 +534,6 @@ ExecInitLimit(Limit *node, EState *estate, int eflags)
 void
 ExecEndLimit(LimitState *node)
 {
-   ExecFreeExprContext(&node->ps);
    ExecEndNode(outerPlanState(node));
 }
 
index 09632678b033211177ac76b1ae2036681a23260c..753ea289151d195f7eee1de85869df565fe654b9 100644 (file)
@@ -239,11 +239,6 @@ ExecInitMaterial(Material *node, EState *estate, int eflags)
 void
 ExecEndMaterial(MaterialState *node)
 {
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * Release tuplestore resources
     */
index 4f04269e2621bdff5452676a11d12785548f6d79..94bf4792873a8ce18dd5919df784c2f00eae83df 100644 (file)
@@ -1091,15 +1091,6 @@ ExecEndMemoize(MemoizeState *node)
    /* Remove the cache context */
    MemoryContextDelete(node->tableContext);
 
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-   /* must drop pointer to cache result tuple */
-   ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-
-   /*
-    * free exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
    /*
     * shut down the subplan
     */
index 00f96d045e0bb97b95d16bc6150693e565a4234a..ed3ebe92e528f828a6c663bd7fb42b20bea438b9 100644 (file)
@@ -1643,17 +1643,6 @@ ExecEndMergeJoin(MergeJoinState *node)
    MJ1_printf("ExecEndMergeJoin: %s\n",
               "ending node processing");
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->js.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->js.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->mj_MarkedTupleSlot);
-
    /*
     * shut down the subplans
     */
index 5005d8c0d12ca28c5f068f549f5ebd2c890cdaa8..d21a178ad5a061e704b3664ea97d994bb76a91fd 100644 (file)
@@ -4446,17 +4446,6 @@ ExecEndModifyTable(ModifyTableState *node)
            ExecDropSingleTupleTableSlot(node->mt_root_tuple_slot);
    }
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
    /*
     * Terminate EPQ execution if active
     */
index 46832ad82fbccfdfd0957ebb095bdea0d13b5008..3547dc2b10ea974189b757880d1b1ff9a92a2f58 100644 (file)
@@ -155,28 +155,6 @@ ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflag
    return scanstate;
 }
 
-/* ----------------------------------------------------------------
- *     ExecEndNamedTuplestoreScan
- *
- *     frees any storage allocated through C routines.
- * ----------------------------------------------------------------
- */
-void
-ExecEndNamedTuplestoreScan(NamedTuplestoreScanState *node)
-{
-   /*
-    * Free exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-}
-
 /* ----------------------------------------------------------------
  *     ExecReScanNamedTuplestoreScan
  *
index b3d52e69ecb70b320761098bdd58fbb0d802d3b9..ebd1406843b56387c8f508a50005abb6c6fcd757 100644 (file)
@@ -364,16 +364,6 @@ ExecEndNestLoop(NestLoopState *node)
    NL1_printf("ExecEndNestLoop: %s\n",
               "ending node processing");
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->js.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->js.ps.ps_ResultTupleSlot);
-
    /*
     * close down subplans
     */
index f6ff3dc44c1ca39b99d85743b1909fba14d83d60..b4bbdc89b19cfe2b9f7219eb94f818e3d3ae148a 100644 (file)
@@ -320,16 +320,6 @@ ExecInitProjectSet(ProjectSet *node, EState *estate, int eflags)
 void
 ExecEndProjectSet(ProjectSetState *node)
 {
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ps);
-
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
    /*
     * shut down subplans
     */
index 4219712d306f958b3ac7ff9d13ac716fd8657146..e9f5732f33b902fd0d47afa82fc7899bdf5efa54 100644 (file)
@@ -240,16 +240,6 @@ ExecInitResult(Result *node, EState *estate, int eflags)
 void
 ExecEndResult(ResultState *node)
 {
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ps);
-
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
    /*
     * shut down subplans
     */
index d7e22b1dbbaebfea2916d86915b354618181f756..41c1ea37ad482dfa73bb51b7ea76c0ec572f6370 100644 (file)
@@ -188,18 +188,6 @@ ExecEndSampleScan(SampleScanState *node)
    if (node->tsmroutine->EndSampleScan)
        node->tsmroutine->EndSampleScan(node);
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * close heap scan
     */
index 4da0f28f7baa6ed8fd4d27a10e45e43652c50688..49a5933aff6985b920e39f0ca7649c79ee1313e6 100644 (file)
@@ -190,18 +190,6 @@ ExecEndSeqScan(SeqScanState *node)
     */
    scanDesc = node->ss.ss_currentScanDesc;
 
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * close heap scan
     */
index 4bc2406b8981754cf0218c4247c50614ef8b675e..98c1b84d43638011536da78ddd35a4b7fa078adc 100644 (file)
@@ -582,13 +582,9 @@ ExecInitSetOp(SetOp *node, EState *estate, int eflags)
 void
 ExecEndSetOp(SetOpState *node)
 {
-   /* clean up tuple table */
-   ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
    /* free subsidiary stuff including hashtable */
    if (node->tableContext)
        MemoryContextDelete(node->tableContext);
-   ExecFreeExprContext(&node->ps);
 
    ExecEndNode(outerPlanState(node));
 }
index c6c72c6e67852b5fad944a8983e9769d9b9f9e70..eea7f2ae15027d1269848b5b4b642ee121007e6d 100644 (file)
@@ -303,13 +303,6 @@ ExecEndSort(SortState *node)
    SO1_printf("ExecEndSort: %s\n",
               "shutting down sort node");
 
-   /*
-    * clean out the tuple table
-    */
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-   /* must drop pointer to sort result tuple */
-   ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-
    /*
     * Release tuplesort resources
     */
index 42471bfc041c7af0f8f7ca068f016289c8c4d370..1ee62956601c7e164fbf6fa486e2ba803a2754e1 100644 (file)
@@ -167,18 +167,6 @@ ExecInitSubqueryScan(SubqueryScan *node, EState *estate, int eflags)
 void
 ExecEndSubqueryScan(SubqueryScanState *node)
 {
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the upper tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * close down subquery
     */
index 791cbd2372400a3bafd5ba7ef5e80b8ab60e9bcf..a60dcd49434fd0189d20b183eb4f646d683edfcc 100644 (file)
@@ -213,18 +213,6 @@ ExecInitTableFuncScan(TableFuncScan *node, EState *estate, int eflags)
 void
 ExecEndTableFuncScan(TableFuncScanState *node)
 {
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
    /*
     * Release tuplestore resources
     */
index 2124c55ef53ecbdf9c2203963e83be816f62e414..da622d3f5f3f447fd93a9a74b6f0a9b17d407d68 100644 (file)
@@ -331,18 +331,6 @@ ExecEndTidRangeScan(TidRangeScanState *node)
 
    if (scan != NULL)
        table_endscan(scan);
-
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clear out tuple table slots
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
 }
 
 /* ----------------------------------------------------------------
index 862bd0330bc7b8bb9cec48efe4aedfdfd1a5d10e..15055077d03249c8284bb923972bc6d605dc1dcd 100644 (file)
@@ -472,18 +472,6 @@ ExecEndTidScan(TidScanState *node)
 {
    if (node->ss.ss_currentScanDesc)
        table_endscan(node->ss.ss_currentScanDesc);
-
-   /*
-    * Free the exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clear out tuple table slots
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
 }
 
 /* ----------------------------------------------------------------
index 45035d74fa71923e7654a0bf9919f7d59b1af755..01f951197c16d274ad64b93127ae205597116492 100644 (file)
@@ -168,11 +168,6 @@ ExecInitUnique(Unique *node, EState *estate, int eflags)
 void
 ExecEndUnique(UniqueState *node)
 {
-   /* clean up tuple table */
-   ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
-   ExecFreeExprContext(&node->ps);
-
    ExecEndNode(outerPlanState(node));
 }
 
index 32ace6301754c0365482c42bcb899dbbcd2ba93e..fbfb067f3beba632f1956a2bc3c7c740bacdc5eb 100644 (file)
@@ -319,30 +319,6 @@ ExecInitValuesScan(ValuesScan *node, EState *estate, int eflags)
    return scanstate;
 }
 
-/* ----------------------------------------------------------------
- *     ExecEndValuesScan
- *
- *     frees any storage allocated through C routines.
- * ----------------------------------------------------------------
- */
-void
-ExecEndValuesScan(ValuesScanState *node)
-{
-   /*
-    * Free both exprcontexts
-    */
-   ExecFreeExprContext(&node->ss.ps);
-   node->ss.ps.ps_ExprContext = node->rowcontext;
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-}
-
 /* ----------------------------------------------------------------
  *     ExecReScanValuesScan
  *
index 310ac23e3a134a5133dbf406c8ec4710862a6a6d..77724a6daaffe4caa859f3db2dca673a2c889c9f 100644 (file)
@@ -2686,23 +2686,6 @@ ExecEndWindowAgg(WindowAggState *node)
 
    release_partition(node);
 
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-   ExecClearTuple(node->first_part_slot);
-   ExecClearTuple(node->agg_row_slot);
-   ExecClearTuple(node->temp_slot_1);
-   ExecClearTuple(node->temp_slot_2);
-   if (node->framehead_slot)
-       ExecClearTuple(node->framehead_slot);
-   if (node->frametail_slot)
-       ExecClearTuple(node->frametail_slot);
-
-   /*
-    * Free both the expr contexts.
-    */
-   ExecFreeExprContext(&node->ss.ps);
-   node->ss.ps.ps_ExprContext = node->tmpcontext;
-   ExecFreeExprContext(&node->ss.ps);
-
    for (i = 0; i < node->numaggs; i++)
    {
        if (node->peragg[i].aggcontext != node->aggcontext)
index 0c13448236a80c093fca64dada666988f46c3e59..17a548865ed65bb1a73d34824de783cc747741c1 100644 (file)
@@ -181,28 +181,6 @@ ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags)
    return scanstate;
 }
 
-/* ----------------------------------------------------------------
- *     ExecEndWorkTableScan
- *
- *     frees any storage allocated through C routines.
- * ----------------------------------------------------------------
- */
-void
-ExecEndWorkTableScan(WorkTableScanState *node)
-{
-   /*
-    * Free exprcontext
-    */
-   ExecFreeExprContext(&node->ss.ps);
-
-   /*
-    * clean out the tuple table
-    */
-   if (node->ss.ps.ps_ResultTupleSlot)
-       ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
-   ExecClearTuple(node->ss.ss_ScanTupleSlot);
-}
-
 /* ----------------------------------------------------------------
  *     ExecReScanWorkTableScan
  *
index c677e490d7622765b9bd13c7a66107905cd0395c..aeebe0e0ff98b828687c825102ae8059559e5407 100644 (file)
@@ -569,7 +569,6 @@ extern void ExecAssignProjectionInfo(PlanState *planstate,
                                     TupleDesc inputDesc);
 extern void ExecConditionalAssignProjectionInfo(PlanState *planstate,
                                                TupleDesc inputDesc, int varno);
-extern void ExecFreeExprContext(PlanState *planstate);
 extern void ExecAssignScanType(ScanState *scanstate, TupleDesc tupDesc);
 extern void ExecCreateScanSlotFromOuterPlan(EState *estate,
                                            ScanState *scanstate,
index 3ff687023afa282f509d3af0c57e3e04051d13b6..9d80236fe5f0aafe6f945d70eee90838f9579967 100644 (file)
@@ -17,7 +17,6 @@
 #include "nodes/execnodes.h"
 
 extern NamedTuplestoreScanState *ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflags);
-extern void ExecEndNamedTuplestoreScan(NamedTuplestoreScanState *node);
 extern void ExecReScanNamedTuplestoreScan(NamedTuplestoreScanState *node);
 
 #endif                         /* NODENAMEDTUPLESTORESCAN_H */
index a52fa678dfe1238cb7b4c4713116f69b9e6bb89d..fe3f043951bcafd4b234e1c5821fa78085b6d2be 100644 (file)
@@ -17,7 +17,6 @@
 #include "nodes/execnodes.h"
 
 extern ValuesScanState *ExecInitValuesScan(ValuesScan *node, EState *estate, int eflags);
-extern void ExecEndValuesScan(ValuesScanState *node);
 extern void ExecReScanValuesScan(ValuesScanState *node);
 
 #endif                         /* NODEVALUESSCAN_H */
index e553a453f3488f10141fce7de16ca585fa44bcd1..f31b22cec4a073b0a7ec2930d6b63ee7d1b7f3ef 100644 (file)
@@ -17,7 +17,6 @@
 #include "nodes/execnodes.h"
 
 extern WorkTableScanState *ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags);
-extern void ExecEndWorkTableScan(WorkTableScanState *node);
 extern void ExecReScanWorkTableScan(WorkTableScanState *node);
 
 #endif                         /* NODEWORKTABLESCAN_H */