summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Langote2023-09-28 00:44:39 +0000
committerAmit Langote2023-09-28 00:44:39 +0000
commitd060e921ea5aa47b6265174c32e1128cebdbc3df (patch)
treec99915a37571d3e5e1792069677069d4bc1d9c86
parent9210afd3bcd65feccb883ace4ed6dcef6a684585 (diff)
Remove obsolete executor cleanup code
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
-rw-r--r--src/backend/executor/execProcnode.c18
-rw-r--r--src/backend/executor/execUtils.c26
-rw-r--r--src/backend/executor/nodeAgg.c10
-rw-r--r--src/backend/executor/nodeBitmapHeapscan.c12
-rw-r--r--src/backend/executor/nodeBitmapIndexscan.c8
-rw-r--r--src/backend/executor/nodeCtescan.c12
-rw-r--r--src/backend/executor/nodeCustom.c7
-rw-r--r--src/backend/executor/nodeForeignscan.c8
-rw-r--r--src/backend/executor/nodeFunctionscan.c15
-rw-r--r--src/backend/executor/nodeGather.c3
-rw-r--r--src/backend/executor/nodeGatherMerge.c3
-rw-r--r--src/backend/executor/nodeGroup.c5
-rw-r--r--src/backend/executor/nodeHash.c5
-rw-r--r--src/backend/executor/nodeHashjoin.c12
-rw-r--r--src/backend/executor/nodeIncrementalSort.c5
-rw-r--r--src/backend/executor/nodeIndexonlyscan.c16
-rw-r--r--src/backend/executor/nodeIndexscan.c16
-rw-r--r--src/backend/executor/nodeLimit.c1
-rw-r--r--src/backend/executor/nodeMaterial.c5
-rw-r--r--src/backend/executor/nodeMemoize.c9
-rw-r--r--src/backend/executor/nodeMergejoin.c11
-rw-r--r--src/backend/executor/nodeModifyTable.c11
-rw-r--r--src/backend/executor/nodeNamedtuplestorescan.c22
-rw-r--r--src/backend/executor/nodeNestloop.c10
-rw-r--r--src/backend/executor/nodeProjectSet.c10
-rw-r--r--src/backend/executor/nodeResult.c10
-rw-r--r--src/backend/executor/nodeSamplescan.c12
-rw-r--r--src/backend/executor/nodeSeqscan.c12
-rw-r--r--src/backend/executor/nodeSetOp.c4
-rw-r--r--src/backend/executor/nodeSort.c7
-rw-r--r--src/backend/executor/nodeSubqueryscan.c12
-rw-r--r--src/backend/executor/nodeTableFuncscan.c12
-rw-r--r--src/backend/executor/nodeTidrangescan.c12
-rw-r--r--src/backend/executor/nodeTidscan.c12
-rw-r--r--src/backend/executor/nodeUnique.c5
-rw-r--r--src/backend/executor/nodeValuesscan.c24
-rw-r--r--src/backend/executor/nodeWindowAgg.c17
-rw-r--r--src/backend/executor/nodeWorktablescan.c22
-rw-r--r--src/include/executor/executor.h1
-rw-r--r--src/include/executor/nodeNamedtuplestorescan.h1
-rw-r--r--src/include/executor/nodeValuesscan.h1
-rw-r--r--src/include/executor/nodeWorktablescan.h1
42 files changed, 6 insertions, 419 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index 4d288bc8d4..b4b5c562c0 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -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;
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index c06b228858..16704c0c2f 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -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
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 468db94fe5..f154f28902 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -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);
}
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index f35df0b8bf..2db0acfc76 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -656,18 +656,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
*/
ExecEndNode(outerPlanState(node));
diff --git a/src/backend/executor/nodeBitmapIndexscan.c b/src/backend/executor/nodeBitmapIndexscan.c
index 83ec9ede89..7cf8532bc9 100644
--- a/src/backend/executor/nodeBitmapIndexscan.c
+++ b/src/backend/executor/nodeBitmapIndexscan.c
@@ -185,14 +185,6 @@ ExecEndBitmapIndexScan(BitmapIndexScanState *node)
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)
*/
if (indexScanDesc)
diff --git a/src/backend/executor/nodeCtescan.c b/src/backend/executor/nodeCtescan.c
index cc4c4243e2..a0c0c4be33 100644
--- a/src/backend/executor/nodeCtescan.c
+++ b/src/backend/executor/nodeCtescan.c
@@ -288,18 +288,6 @@ 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.
*/
if (node->leader == node)
diff --git a/src/backend/executor/nodeCustom.c b/src/backend/executor/nodeCustom.c
index bd42c65b29..28b5bb9353 100644
--- a/src/backend/executor/nodeCustom.c
+++ b/src/backend/executor/nodeCustom.c
@@ -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
diff --git a/src/backend/executor/nodeForeignscan.c b/src/backend/executor/nodeForeignscan.c
index c2139acca0..73913ebb18 100644
--- a/src/backend/executor/nodeForeignscan.c
+++ b/src/backend/executor/nodeForeignscan.c
@@ -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);
}
/* ----------------------------------------------------------------
diff --git a/src/backend/executor/nodeFunctionscan.c b/src/backend/executor/nodeFunctionscan.c
index dd06ef8aee..2dddbcda14 100644
--- a/src/backend/executor/nodeFunctionscan.c
+++ b/src/backend/executor/nodeFunctionscan.c
@@ -524,27 +524,12 @@ 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
*/
for (i = 0; i < node->nfuncs; i++)
{
FunctionScanPerFuncState *fs = &node->funcstates[i];
- if (fs->func_slot)
- ExecClearTuple(fs->func_slot);
-
if (fs->tstore != NULL)
{
tuplestore_end(node->funcstates[i].tstore);
diff --git a/src/backend/executor/nodeGather.c b/src/backend/executor/nodeGather.c
index 307fc10eea..bb2500a469 100644
--- a/src/backend/executor/nodeGather.c
+++ b/src/backend/executor/nodeGather.c
@@ -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);
}
/*
diff --git a/src/backend/executor/nodeGatherMerge.c b/src/backend/executor/nodeGatherMerge.c
index 9d5e1a46e9..7a71a58509 100644
--- a/src/backend/executor/nodeGatherMerge.c
+++ b/src/backend/executor/nodeGatherMerge.c
@@ -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);
}
/* ----------------------------------------------------------------
diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c
index 25a1618952..8c650f0e46 100644
--- a/src/backend/executor/nodeGroup.c
+++ b/src/backend/executor/nodeGroup.c
@@ -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);
}
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 8b5c35b82b..e72f0986c2 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -416,11 +416,6 @@ ExecEndHash(HashState *node)
PlanState *outerPlan;
/*
- * free exprcontext
- */
- ExecFreeExprContext(&node->ps);
-
- /*
* shut down the subplan
*/
outerPlan = outerPlanState(node);
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 980746128b..aea44a9d56 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -868,18 +868,6 @@ ExecEndHashJoin(HashJoinState *node)
}
/*
- * 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
*/
ExecEndNode(outerPlanState(node));
diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index 7683e3341c..cd094a190c 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -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);
diff --git a/src/backend/executor/nodeIndexonlyscan.c b/src/backend/executor/nodeIndexonlyscan.c
index 0b43a9b969..f1db35665c 100644
--- a/src/backend/executor/nodeIndexonlyscan.c
+++ b/src/backend/executor/nodeIndexonlyscan.c
@@ -381,22 +381,6 @@ ExecEndIndexOnlyScan(IndexOnlyScanState *node)
}
/*
- * 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)
*/
if (indexScanDesc)
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index 4540c7781d..14b9c00217 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -795,22 +795,6 @@ ExecEndIndexScan(IndexScanState *node)
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)
*/
if (indexScanDesc)
diff --git a/src/backend/executor/nodeLimit.c b/src/backend/executor/nodeLimit.c
index 425fbfc405..5654158e3e 100644
--- a/src/backend/executor/nodeLimit.c
+++ b/src/backend/executor/nodeLimit.c
@@ -534,7 +534,6 @@ ExecInitLimit(Limit *node, EState *estate, int eflags)
void
ExecEndLimit(LimitState *node)
{
- ExecFreeExprContext(&node->ps);
ExecEndNode(outerPlanState(node));
}
diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c
index 09632678b0..753ea28915 100644
--- a/src/backend/executor/nodeMaterial.c
+++ b/src/backend/executor/nodeMaterial.c
@@ -240,11 +240,6 @@ void
ExecEndMaterial(MaterialState *node)
{
/*
- * clean out the tuple table
- */
- ExecClearTuple(node->ss.ss_ScanTupleSlot);
-
- /*
* Release tuplestore resources
*/
if (node->tuplestorestate != NULL)
diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c
index 4f04269e26..94bf479287 100644
--- a/src/backend/executor/nodeMemoize.c
+++ b/src/backend/executor/nodeMemoize.c
@@ -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
*/
diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c
index 00f96d045e..ed3ebe92e5 100644
--- a/src/backend/executor/nodeMergejoin.c
+++ b/src/backend/executor/nodeMergejoin.c
@@ -1644,17 +1644,6 @@ ExecEndMergeJoin(MergeJoinState *node)
"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
*/
ExecEndNode(innerPlanState(node));
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 5005d8c0d1..d21a178ad5 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -4447,17 +4447,6 @@ ExecEndModifyTable(ModifyTableState *node)
}
/*
- * 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
*/
EvalPlanQualEnd(&node->mt_epqstate);
diff --git a/src/backend/executor/nodeNamedtuplestorescan.c b/src/backend/executor/nodeNamedtuplestorescan.c
index 46832ad82f..3547dc2b10 100644
--- a/src/backend/executor/nodeNamedtuplestorescan.c
+++ b/src/backend/executor/nodeNamedtuplestorescan.c
@@ -156,28 +156,6 @@ ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflag
}
/* ----------------------------------------------------------------
- * 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
*
* Rescans the relation.
diff --git a/src/backend/executor/nodeNestloop.c b/src/backend/executor/nodeNestloop.c
index b3d52e69ec..ebd1406843 100644
--- a/src/backend/executor/nodeNestloop.c
+++ b/src/backend/executor/nodeNestloop.c
@@ -365,16 +365,6 @@ ExecEndNestLoop(NestLoopState *node)
"ending node processing");
/*
- * Free the exprcontext
- */
- ExecFreeExprContext(&node->js.ps);
-
- /*
- * clean out the tuple table
- */
- ExecClearTuple(node->js.ps.ps_ResultTupleSlot);
-
- /*
* close down subplans
*/
ExecEndNode(outerPlanState(node));
diff --git a/src/backend/executor/nodeProjectSet.c b/src/backend/executor/nodeProjectSet.c
index f6ff3dc44c..b4bbdc89b1 100644
--- a/src/backend/executor/nodeProjectSet.c
+++ b/src/backend/executor/nodeProjectSet.c
@@ -321,16 +321,6 @@ void
ExecEndProjectSet(ProjectSetState *node)
{
/*
- * Free the exprcontext
- */
- ExecFreeExprContext(&node->ps);
-
- /*
- * clean out the tuple table
- */
- ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
- /*
* shut down subplans
*/
ExecEndNode(outerPlanState(node));
diff --git a/src/backend/executor/nodeResult.c b/src/backend/executor/nodeResult.c
index 4219712d30..e9f5732f33 100644
--- a/src/backend/executor/nodeResult.c
+++ b/src/backend/executor/nodeResult.c
@@ -241,16 +241,6 @@ void
ExecEndResult(ResultState *node)
{
/*
- * Free the exprcontext
- */
- ExecFreeExprContext(&node->ps);
-
- /*
- * clean out the tuple table
- */
- ExecClearTuple(node->ps.ps_ResultTupleSlot);
-
- /*
* shut down subplans
*/
ExecEndNode(outerPlanState(node));
diff --git a/src/backend/executor/nodeSamplescan.c b/src/backend/executor/nodeSamplescan.c
index d7e22b1dbb..41c1ea37ad 100644
--- a/src/backend/executor/nodeSamplescan.c
+++ b/src/backend/executor/nodeSamplescan.c
@@ -189,18 +189,6 @@ ExecEndSampleScan(SampleScanState *node)
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
*/
if (node->ss.ss_currentScanDesc)
diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c
index 4da0f28f7b..49a5933aff 100644
--- a/src/backend/executor/nodeSeqscan.c
+++ b/src/backend/executor/nodeSeqscan.c
@@ -191,18 +191,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
*/
if (scanDesc != NULL)
diff --git a/src/backend/executor/nodeSetOp.c b/src/backend/executor/nodeSetOp.c
index 4bc2406b89..98c1b84d43 100644
--- a/src/backend/executor/nodeSetOp.c
+++ b/src/backend/executor/nodeSetOp.c
@@ -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));
}
diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c
index c6c72c6e67..eea7f2ae15 100644
--- a/src/backend/executor/nodeSort.c
+++ b/src/backend/executor/nodeSort.c
@@ -304,13 +304,6 @@ ExecEndSort(SortState *node)
"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
*/
if (node->tuplesortstate != NULL)
diff --git a/src/backend/executor/nodeSubqueryscan.c b/src/backend/executor/nodeSubqueryscan.c
index 42471bfc04..1ee6295660 100644
--- a/src/backend/executor/nodeSubqueryscan.c
+++ b/src/backend/executor/nodeSubqueryscan.c
@@ -168,18 +168,6 @@ 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
*/
ExecEndNode(node->subplan);
diff --git a/src/backend/executor/nodeTableFuncscan.c b/src/backend/executor/nodeTableFuncscan.c
index 791cbd2372..a60dcd4943 100644
--- a/src/backend/executor/nodeTableFuncscan.c
+++ b/src/backend/executor/nodeTableFuncscan.c
@@ -214,18 +214,6 @@ 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
*/
if (node->tupstore != NULL)
diff --git a/src/backend/executor/nodeTidrangescan.c b/src/backend/executor/nodeTidrangescan.c
index 2124c55ef5..da622d3f5f 100644
--- a/src/backend/executor/nodeTidrangescan.c
+++ b/src/backend/executor/nodeTidrangescan.c
@@ -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);
}
/* ----------------------------------------------------------------
diff --git a/src/backend/executor/nodeTidscan.c b/src/backend/executor/nodeTidscan.c
index 862bd0330b..15055077d0 100644
--- a/src/backend/executor/nodeTidscan.c
+++ b/src/backend/executor/nodeTidscan.c
@@ -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);
}
/* ----------------------------------------------------------------
diff --git a/src/backend/executor/nodeUnique.c b/src/backend/executor/nodeUnique.c
index 45035d74fa..01f951197c 100644
--- a/src/backend/executor/nodeUnique.c
+++ b/src/backend/executor/nodeUnique.c
@@ -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));
}
diff --git a/src/backend/executor/nodeValuesscan.c b/src/backend/executor/nodeValuesscan.c
index 32ace63017..fbfb067f3b 100644
--- a/src/backend/executor/nodeValuesscan.c
+++ b/src/backend/executor/nodeValuesscan.c
@@ -320,30 +320,6 @@ ExecInitValuesScan(ValuesScan *node, EState *estate, int eflags)
}
/* ----------------------------------------------------------------
- * 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
*
* Rescans the relation.
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 310ac23e3a..77724a6daa 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -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)
diff --git a/src/backend/executor/nodeWorktablescan.c b/src/backend/executor/nodeWorktablescan.c
index 0c13448236..17a548865e 100644
--- a/src/backend/executor/nodeWorktablescan.c
+++ b/src/backend/executor/nodeWorktablescan.c
@@ -182,28 +182,6 @@ ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags)
}
/* ----------------------------------------------------------------
- * 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
*
* Rescans the relation.
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index c677e490d7..aeebe0e0ff 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -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,
diff --git a/src/include/executor/nodeNamedtuplestorescan.h b/src/include/executor/nodeNamedtuplestorescan.h
index 3ff687023a..9d80236fe5 100644
--- a/src/include/executor/nodeNamedtuplestorescan.h
+++ b/src/include/executor/nodeNamedtuplestorescan.h
@@ -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 */
diff --git a/src/include/executor/nodeValuesscan.h b/src/include/executor/nodeValuesscan.h
index a52fa678df..fe3f043951 100644
--- a/src/include/executor/nodeValuesscan.h
+++ b/src/include/executor/nodeValuesscan.h
@@ -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 */
diff --git a/src/include/executor/nodeWorktablescan.h b/src/include/executor/nodeWorktablescan.h
index e553a453f3..f31b22cec4 100644
--- a/src/include/executor/nodeWorktablescan.h
+++ b/src/include/executor/nodeWorktablescan.h
@@ -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 */