diff options
Diffstat (limited to 'src/backend/executor/execProcnode.c')
-rw-r--r-- | src/backend/executor/execProcnode.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c index 03c2febc3e1..5bc1d489421 100644 --- a/src/backend/executor/execProcnode.c +++ b/src/backend/executor/execProcnode.c @@ -100,6 +100,7 @@ #include "executor/nodeMergejoin.h" #include "executor/nodeModifyTable.h" #include "executor/nodeNestloop.h" +#include "executor/nodeGather.h" #include "executor/nodeRecursiveunion.h" #include "executor/nodeResult.h" #include "executor/nodeSamplescan.h" @@ -113,6 +114,7 @@ #include "executor/nodeValuesscan.h" #include "executor/nodeWindowAgg.h" #include "executor/nodeWorktablescan.h" +#include "nodes/nodeFuncs.h" #include "miscadmin.h" @@ -307,6 +309,11 @@ ExecInitNode(Plan *node, EState *estate, int eflags) estate, eflags); break; + case T_Gather: + result = (PlanState *) ExecInitGather((Gather *) node, + estate, eflags); + break; + case T_Hash: result = (PlanState *) ExecInitHash((Hash *) node, estate, eflags); @@ -504,6 +511,10 @@ ExecProcNode(PlanState *node) result = ExecUnique((UniqueState *) node); break; + case T_GatherState: + result = ExecGather((GatherState *) node); + break; + case T_HashState: result = ExecHash((HashState *) node); break; @@ -658,6 +669,10 @@ ExecEndNode(PlanState *node) ExecEndSampleScan((SampleScanState *) node); break; + case T_GatherState: + ExecEndGather((GatherState *) node); + break; + case T_IndexScanState: ExecEndIndexScan((IndexScanState *) node); break; @@ -769,3 +784,34 @@ ExecEndNode(PlanState *node) break; } } + +/* + * ExecShutdownNode + * + * Give execution nodes a chance to stop asynchronous resource consumption + * and release any resources still held. Currently, this is only used for + * parallel query, but we might want to extend it to other cases also (e.g. + * FDW). We might also want to call it sooner, as soon as it's evident that + * no more rows will be needed (e.g. when a Limit is filled) rather than only + * at the end of ExecutorRun. + */ +bool +ExecShutdownNode(PlanState *node) +{ + if (node == NULL) + return false; + + switch (nodeTag(node)) + { + case T_GatherState: + { + ExecShutdownGather((GatherState *) node); + return true; + } + break; + default: + break; + } + + return planstate_tree_walker(node, ExecShutdownNode, NULL); +} |