PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
execProcnode.c File Reference
Include dependency graph for execProcnode.c:

Go to the source code of this file.

Functions

PlanStateExecInitNode (Plan *node, EState *estate, int eflags)
 
TupleTableSlotExecProcNode (PlanState *node)
 
NodeMultiExecProcNode (PlanState *node)
 
void ExecEndNode (PlanState *node)
 
bool ExecShutdownNode (PlanState *node)
 

Function Documentation

void ExecEndNode ( PlanState node)

Definition at line 624 of file execProcnode.c.

References bms_free(), PlanState::chgParam, elog, ERROR, ExecEndAgg(), ExecEndAppend(), ExecEndBitmapAnd(), ExecEndBitmapHeapScan(), ExecEndBitmapIndexScan(), ExecEndBitmapOr(), ExecEndCteScan(), ExecEndCustomScan(), ExecEndForeignScan(), ExecEndFunctionScan(), ExecEndGather(), ExecEndGroup(), ExecEndHash(), ExecEndHashJoin(), ExecEndIndexOnlyScan(), ExecEndIndexScan(), ExecEndLimit(), ExecEndLockRows(), ExecEndMaterial(), ExecEndMergeAppend(), ExecEndMergeJoin(), ExecEndModifyTable(), ExecEndNestLoop(), ExecEndProjectSet(), ExecEndRecursiveUnion(), ExecEndResult(), ExecEndSampleScan(), ExecEndSeqScan(), ExecEndSetOp(), ExecEndSort(), ExecEndSubqueryScan(), ExecEndTidScan(), ExecEndUnique(), ExecEndValuesScan(), ExecEndWindowAgg(), ExecEndWorkTableScan(), nodeTag, NULL, T_AggState, T_AppendState, T_BitmapAndState, T_BitmapHeapScanState, T_BitmapIndexScanState, T_BitmapOrState, T_CteScanState, T_CustomScanState, T_ForeignScanState, T_FunctionScanState, T_GatherState, T_GroupState, T_HashJoinState, T_HashState, T_IndexOnlyScanState, T_IndexScanState, T_LimitState, T_LockRowsState, T_MaterialState, T_MergeAppendState, T_MergeJoinState, T_ModifyTableState, T_NestLoopState, T_ProjectSetState, T_RecursiveUnionState, T_ResultState, T_SampleScanState, T_SeqScanState, T_SetOpState, T_SortState, T_SubqueryScanState, T_TidScanState, T_UniqueState, T_ValuesScanState, T_WindowAggState, and T_WorkTableScanState.

Referenced by EvalPlanQualEnd(), ExecEndAgg(), ExecEndAppend(), ExecEndBitmapAnd(), ExecEndBitmapHeapScan(), ExecEndBitmapOr(), ExecEndForeignScan(), ExecEndGather(), ExecEndGroup(), ExecEndHash(), ExecEndHashJoin(), ExecEndLimit(), ExecEndLockRows(), ExecEndMaterial(), ExecEndMergeAppend(), ExecEndMergeJoin(), ExecEndModifyTable(), ExecEndNestLoop(), ExecEndPlan(), ExecEndProjectSet(), ExecEndRecursiveUnion(), ExecEndResult(), ExecEndSetOp(), ExecEndSort(), ExecEndSubqueryScan(), ExecEndUnique(), and ExecEndWindowAgg().

625 {
626  /*
627  * do nothing when we get to the end of a leaf on tree.
628  */
629  if (node == NULL)
630  return;
631 
632  if (node->chgParam != NULL)
633  {
634  bms_free(node->chgParam);
635  node->chgParam = NULL;
636  }
637 
638  switch (nodeTag(node))
639  {
640  /*
641  * control nodes
642  */
643  case T_ResultState:
644  ExecEndResult((ResultState *) node);
645  break;
646 
647  case T_ProjectSetState:
649  break;
650 
651  case T_ModifyTableState:
653  break;
654 
655  case T_AppendState:
656  ExecEndAppend((AppendState *) node);
657  break;
658 
659  case T_MergeAppendState:
661  break;
662 
665  break;
666 
667  case T_BitmapAndState:
669  break;
670 
671  case T_BitmapOrState:
672  ExecEndBitmapOr((BitmapOrState *) node);
673  break;
674 
675  /*
676  * scan nodes
677  */
678  case T_SeqScanState:
679  ExecEndSeqScan((SeqScanState *) node);
680  break;
681 
682  case T_SampleScanState:
684  break;
685 
686  case T_GatherState:
687  ExecEndGather((GatherState *) node);
688  break;
689 
690  case T_IndexScanState:
692  break;
693 
696  break;
697 
700  break;
701 
704  break;
705 
706  case T_TidScanState:
707  ExecEndTidScan((TidScanState *) node);
708  break;
709 
710  case T_SubqueryScanState:
712  break;
713 
714  case T_FunctionScanState:
716  break;
717 
718  case T_ValuesScanState:
720  break;
721 
722  case T_CteScanState:
723  ExecEndCteScan((CteScanState *) node);
724  break;
725 
728  break;
729 
730  case T_ForeignScanState:
732  break;
733 
734  case T_CustomScanState:
736  break;
737 
738  /*
739  * join nodes
740  */
741  case T_NestLoopState:
742  ExecEndNestLoop((NestLoopState *) node);
743  break;
744 
745  case T_MergeJoinState:
747  break;
748 
749  case T_HashJoinState:
750  ExecEndHashJoin((HashJoinState *) node);
751  break;
752 
753  /*
754  * materialization nodes
755  */
756  case T_MaterialState:
757  ExecEndMaterial((MaterialState *) node);
758  break;
759 
760  case T_SortState:
761  ExecEndSort((SortState *) node);
762  break;
763 
764  case T_GroupState:
765  ExecEndGroup((GroupState *) node);
766  break;
767 
768  case T_AggState:
769  ExecEndAgg((AggState *) node);
770  break;
771 
772  case T_WindowAggState:
774  break;
775 
776  case T_UniqueState:
777  ExecEndUnique((UniqueState *) node);
778  break;
779 
780  case T_HashState:
781  ExecEndHash((HashState *) node);
782  break;
783 
784  case T_SetOpState:
785  ExecEndSetOp((SetOpState *) node);
786  break;
787 
788  case T_LockRowsState:
789  ExecEndLockRows((LockRowsState *) node);
790  break;
791 
792  case T_LimitState:
793  ExecEndLimit((LimitState *) node);
794  break;
795 
796  default:
797  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
798  break;
799  }
800 }
void ExecEndGroup(GroupState *node)
Definition: nodeGroup.c:230
void ExecEndSetOp(SetOpState *node)
Definition: nodeSetOp.c:575
void ExecEndFunctionScan(FunctionScanState *node)
void ExecEndNestLoop(NestLoopState *node)
Definition: nodeNestloop.c:358
void ExecEndIndexScan(IndexScanState *node)
void ExecEndLimit(LimitState *node)
Definition: nodeLimit.c:426
void ExecEndUnique(UniqueState *node)
Definition: nodeUnique.c:173
void ExecEndWorkTableScan(WorkTableScanState *node)
void ExecEndLockRows(LockRowsState *node)
Definition: nodeLockRows.c:446
void ExecEndBitmapAnd(BitmapAndState *node)
void ExecEndRecursiveUnion(RecursiveUnionState *node)
void ExecEndSubqueryScan(SubqueryScanState *node)
void ExecEndHashJoin(HashJoinState *node)
Definition: nodeHashjoin.c:549
void ExecEndResult(ResultState *node)
Definition: nodeResult.c:247
#define ERROR
Definition: elog.h:43
void ExecEndAppend(AppendState *node)
Definition: nodeAppend.c:246
void ExecEndForeignScan(ForeignScanState *node)
void ExecEndSort(SortState *node)
Definition: nodeSort.c:223
void ExecEndBitmapIndexScan(BitmapIndexScanState *node)
void ExecEndValuesScan(ValuesScanState *node)
void ExecEndMergeJoin(MergeJoinState *node)
void ExecEndSeqScan(SeqScanState *node)
Definition: nodeSeqscan.c:225
void ExecEndIndexOnlyScan(IndexOnlyScanState *node)
void ExecEndTidScan(TidScanState *node)
Definition: nodeTidscan.c:420
Bitmapset * chgParam
Definition: execnodes.h:1072
void ExecEndCteScan(CteScanState *node)
Definition: nodeCtescan.c:281
void ExecEndCustomScan(CustomScanState *node)
Definition: nodeCustom.c:116
void ExecEndBitmapOr(BitmapOrState *node)
Definition: nodeBitmapOr.c:180
void ExecEndSampleScan(SampleScanState *node)
void bms_free(Bitmapset *a)
Definition: bitmapset.c:200
void ExecEndWindowAgg(WindowAggState *node)
#define NULL
Definition: c.h:226
void ExecEndMergeAppend(MergeAppendState *node)
#define nodeTag(nodeptr)
Definition: nodes.h:513
void ExecEndHash(HashState *node)
Definition: nodeHash.c:222
void ExecEndProjectSet(ProjectSetState *node)
void ExecEndMaterial(MaterialState *node)
Definition: nodeMaterial.c:240
#define elog
Definition: elog.h:219
void ExecEndBitmapHeapScan(BitmapHeapScanState *node)
void ExecEndAgg(AggState *node)
Definition: nodeAgg.c:3487
void ExecEndModifyTable(ModifyTableState *node)
void ExecEndGather(GatherState *node)
Definition: nodeGather.c:230
PlanState* ExecInitNode ( Plan node,
EState estate,
int  eflags 
)

Definition at line 137 of file execProcnode.c.

References Assert, elog, ERROR, EState::es_instrument, ExecInitAgg(), ExecInitAppend(), ExecInitBitmapAnd(), ExecInitBitmapHeapScan(), ExecInitBitmapIndexScan(), ExecInitBitmapOr(), ExecInitCteScan(), ExecInitCustomScan(), ExecInitForeignScan(), ExecInitFunctionScan(), ExecInitGather(), ExecInitGroup(), ExecInitHash(), ExecInitHashJoin(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), ExecInitLimit(), ExecInitLockRows(), ExecInitMaterial(), ExecInitMergeAppend(), ExecInitMergeJoin(), ExecInitModifyTable(), ExecInitNestLoop(), ExecInitProjectSet(), ExecInitRecursiveUnion(), ExecInitResult(), ExecInitSampleScan(), ExecInitSeqScan(), ExecInitSetOp(), ExecInitSort(), ExecInitSubPlan(), ExecInitSubqueryScan(), ExecInitTidScan(), ExecInitUnique(), ExecInitValuesScan(), ExecInitWindowAgg(), ExecInitWorkTableScan(), Plan::initPlan, PlanState::initPlan, InstrAlloc(), PlanState::instrument, IsA, lappend(), lfirst, NIL, nodeTag, NULL, T_Agg, T_Append, T_BitmapAnd, T_BitmapHeapScan, T_BitmapIndexScan, T_BitmapOr, T_CteScan, T_CustomScan, T_ForeignScan, T_FunctionScan, T_Gather, T_Group, T_Hash, T_HashJoin, T_IndexOnlyScan, T_IndexScan, T_Limit, T_LockRows, T_Material, T_MergeAppend, T_MergeJoin, T_ModifyTable, T_NestLoop, T_ProjectSet, T_RecursiveUnion, T_Result, T_SampleScan, T_SeqScan, T_SetOp, T_Sort, T_SubqueryScan, T_TidScan, T_Unique, T_ValuesScan, T_WindowAgg, and T_WorkTableScan.

Referenced by EvalPlanQualStart(), ExecInitAgg(), ExecInitAppend(), ExecInitBitmapAnd(), ExecInitBitmapHeapScan(), ExecInitBitmapOr(), ExecInitForeignScan(), ExecInitGather(), ExecInitGroup(), ExecInitHash(), ExecInitHashJoin(), ExecInitLimit(), ExecInitLockRows(), ExecInitMaterial(), ExecInitMergeAppend(), ExecInitMergeJoin(), ExecInitModifyTable(), ExecInitNestLoop(), ExecInitProjectSet(), ExecInitRecursiveUnion(), ExecInitResult(), ExecInitSetOp(), ExecInitSort(), ExecInitSubqueryScan(), ExecInitUnique(), ExecInitWindowAgg(), and InitPlan().

138 {
139  PlanState *result;
140  List *subps;
141  ListCell *l;
142 
143  /*
144  * do nothing when we get to the end of a leaf on tree.
145  */
146  if (node == NULL)
147  return NULL;
148 
149  switch (nodeTag(node))
150  {
151  /*
152  * control nodes
153  */
154  case T_Result:
155  result = (PlanState *) ExecInitResult((Result *) node,
156  estate, eflags);
157  break;
158 
159  case T_ProjectSet:
160  result = (PlanState *) ExecInitProjectSet((ProjectSet *) node,
161  estate, eflags);
162  break;
163 
164  case T_ModifyTable:
165  result = (PlanState *) ExecInitModifyTable((ModifyTable *) node,
166  estate, eflags);
167  break;
168 
169  case T_Append:
170  result = (PlanState *) ExecInitAppend((Append *) node,
171  estate, eflags);
172  break;
173 
174  case T_MergeAppend:
175  result = (PlanState *) ExecInitMergeAppend((MergeAppend *) node,
176  estate, eflags);
177  break;
178 
179  case T_RecursiveUnion:
180  result = (PlanState *) ExecInitRecursiveUnion((RecursiveUnion *) node,
181  estate, eflags);
182  break;
183 
184  case T_BitmapAnd:
185  result = (PlanState *) ExecInitBitmapAnd((BitmapAnd *) node,
186  estate, eflags);
187  break;
188 
189  case T_BitmapOr:
190  result = (PlanState *) ExecInitBitmapOr((BitmapOr *) node,
191  estate, eflags);
192  break;
193 
194  /*
195  * scan nodes
196  */
197  case T_SeqScan:
198  result = (PlanState *) ExecInitSeqScan((SeqScan *) node,
199  estate, eflags);
200  break;
201 
202  case T_SampleScan:
203  result = (PlanState *) ExecInitSampleScan((SampleScan *) node,
204  estate, eflags);
205  break;
206 
207  case T_IndexScan:
208  result = (PlanState *) ExecInitIndexScan((IndexScan *) node,
209  estate, eflags);
210  break;
211 
212  case T_IndexOnlyScan:
213  result = (PlanState *) ExecInitIndexOnlyScan((IndexOnlyScan *) node,
214  estate, eflags);
215  break;
216 
217  case T_BitmapIndexScan:
218  result = (PlanState *) ExecInitBitmapIndexScan((BitmapIndexScan *) node,
219  estate, eflags);
220  break;
221 
222  case T_BitmapHeapScan:
223  result = (PlanState *) ExecInitBitmapHeapScan((BitmapHeapScan *) node,
224  estate, eflags);
225  break;
226 
227  case T_TidScan:
228  result = (PlanState *) ExecInitTidScan((TidScan *) node,
229  estate, eflags);
230  break;
231 
232  case T_SubqueryScan:
233  result = (PlanState *) ExecInitSubqueryScan((SubqueryScan *) node,
234  estate, eflags);
235  break;
236 
237  case T_FunctionScan:
238  result = (PlanState *) ExecInitFunctionScan((FunctionScan *) node,
239  estate, eflags);
240  break;
241 
242  case T_ValuesScan:
243  result = (PlanState *) ExecInitValuesScan((ValuesScan *) node,
244  estate, eflags);
245  break;
246 
247  case T_CteScan:
248  result = (PlanState *) ExecInitCteScan((CteScan *) node,
249  estate, eflags);
250  break;
251 
252  case T_WorkTableScan:
253  result = (PlanState *) ExecInitWorkTableScan((WorkTableScan *) node,
254  estate, eflags);
255  break;
256 
257  case T_ForeignScan:
258  result = (PlanState *) ExecInitForeignScan((ForeignScan *) node,
259  estate, eflags);
260  break;
261 
262  case T_CustomScan:
263  result = (PlanState *) ExecInitCustomScan((CustomScan *) node,
264  estate, eflags);
265  break;
266 
267  /*
268  * join nodes
269  */
270  case T_NestLoop:
271  result = (PlanState *) ExecInitNestLoop((NestLoop *) node,
272  estate, eflags);
273  break;
274 
275  case T_MergeJoin:
276  result = (PlanState *) ExecInitMergeJoin((MergeJoin *) node,
277  estate, eflags);
278  break;
279 
280  case T_HashJoin:
281  result = (PlanState *) ExecInitHashJoin((HashJoin *) node,
282  estate, eflags);
283  break;
284 
285  /*
286  * materialization nodes
287  */
288  case T_Material:
289  result = (PlanState *) ExecInitMaterial((Material *) node,
290  estate, eflags);
291  break;
292 
293  case T_Sort:
294  result = (PlanState *) ExecInitSort((Sort *) node,
295  estate, eflags);
296  break;
297 
298  case T_Group:
299  result = (PlanState *) ExecInitGroup((Group *) node,
300  estate, eflags);
301  break;
302 
303  case T_Agg:
304  result = (PlanState *) ExecInitAgg((Agg *) node,
305  estate, eflags);
306  break;
307 
308  case T_WindowAgg:
309  result = (PlanState *) ExecInitWindowAgg((WindowAgg *) node,
310  estate, eflags);
311  break;
312 
313  case T_Unique:
314  result = (PlanState *) ExecInitUnique((Unique *) node,
315  estate, eflags);
316  break;
317 
318  case T_Gather:
319  result = (PlanState *) ExecInitGather((Gather *) node,
320  estate, eflags);
321  break;
322 
323  case T_Hash:
324  result = (PlanState *) ExecInitHash((Hash *) node,
325  estate, eflags);
326  break;
327 
328  case T_SetOp:
329  result = (PlanState *) ExecInitSetOp((SetOp *) node,
330  estate, eflags);
331  break;
332 
333  case T_LockRows:
334  result = (PlanState *) ExecInitLockRows((LockRows *) node,
335  estate, eflags);
336  break;
337 
338  case T_Limit:
339  result = (PlanState *) ExecInitLimit((Limit *) node,
340  estate, eflags);
341  break;
342 
343  default:
344  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
345  result = NULL; /* keep compiler quiet */
346  break;
347  }
348 
349  /*
350  * Initialize any initPlans present in this node. The planner put them in
351  * a separate list for us.
352  */
353  subps = NIL;
354  foreach(l, node->initPlan)
355  {
356  SubPlan *subplan = (SubPlan *) lfirst(l);
357  SubPlanState *sstate;
358 
359  Assert(IsA(subplan, SubPlan));
360  sstate = ExecInitSubPlan(subplan, result);
361  subps = lappend(subps, sstate);
362  }
363  result->initPlan = subps;
364 
365  /* Set up instrumentation for this node if requested */
366  if (estate->es_instrument)
367  result->instrument = InstrAlloc(1, estate->es_instrument);
368 
369  return result;
370 }
MergeJoinState * ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags)
#define NIL
Definition: pg_list.h:69
Definition: nodes.h:75
SortState * ExecInitSort(Sort *node, EState *estate, int eflags)
Definition: nodeSort.c:152
#define IsA(nodeptr, _type_)
Definition: nodes.h:559
BitmapHeapScanState * ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
Definition: nodes.h:77
Instrumentation * instrument
Definition: execnodes.h:1053
GroupState * ExecInitGroup(Group *node, EState *estate, int eflags)
Definition: nodeGroup.c:162
MergeAppendState * ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags)
List * initPlan
Definition: execnodes.h:1065
RecursiveUnionState * ExecInitRecursiveUnion(RecursiveUnion *node, EState *estate, int eflags)
NestLoopState * ExecInitNestLoop(NestLoop *node, EState *estate, int eflags)
Definition: nodeNestloop.c:258
LockRowsState * ExecInitLockRows(LockRows *node, EState *estate, int eflags)
Definition: nodeLockRows.c:348
HashState * ExecInitHash(Hash *node, EState *estate, int eflags)
Definition: nodeHash.c:162
CteScanState * ExecInitCteScan(CteScan *node, EState *estate, int eflags)
Definition: nodeCtescan.c:166
Definition: nodes.h:48
Instrumentation * InstrAlloc(int n, int instrument_options)
Definition: instrument.c:30
AppendState * ExecInitAppend(Append *node, EState *estate, int eflags)
Definition: nodeAppend.c:120
Definition: nodes.h:73
GatherState * ExecInitGather(Gather *node, EState *estate, int eflags)
Definition: nodeGather.c:56
SubPlanState * ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
Definition: nodeSubplan.c:692
AggState * ExecInitAgg(Agg *node, EState *estate, int eflags)
Definition: nodeAgg.c:2395
TidScanState * ExecInitTidScan(TidScan *node, EState *estate, int eflags)
Definition: nodeTidscan.c:451
Definition: nodes.h:45
#define ERROR
Definition: elog.h:43
IndexScanState * ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
CustomScanState * ExecInitCustomScan(CustomScan *cscan, EState *estate, int eflags)
Definition: nodeCustom.c:24
BitmapIndexScanState * ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
Definition: nodes.h:74
SampleScanState * ExecInitSampleScan(SampleScan *node, EState *estate, int eflags)
ModifyTableState * ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
SubqueryScanState * ExecInitSubqueryScan(SubqueryScan *node, EState *estate, int eflags)
SetOpState * ExecInitSetOp(SetOp *node, EState *estate, int eflags)
Definition: nodeSetOp.c:470
FunctionScanState * ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
List * lappend(List *list, void *datum)
Definition: list.c:128
ValuesScanState * ExecInitValuesScan(ValuesScan *node, EState *estate, int eflags)
BitmapAndState * ExecInitBitmapAnd(BitmapAnd *node, EState *estate, int eflags)
Definition: nodeBitmapAnd.c:42
HashJoinState * ExecInitHashJoin(HashJoin *node, EState *estate, int eflags)
Definition: nodeHashjoin.c:384
UniqueState * ExecInitUnique(Unique *node, EState *estate, int eflags)
Definition: nodeUnique.c:112
Definition: nodes.h:79
BitmapOrState * ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags)
Definition: nodeBitmapOr.c:43
#define NULL
Definition: c.h:226
IndexOnlyScanState * ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags)
#define Assert(condition)
Definition: c.h:671
#define lfirst(lc)
Definition: pg_list.h:106
ResultState * ExecInitResult(Result *node, EState *estate, int eflags)
Definition: nodeResult.c:179
WindowAggState * ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
ProjectSetState * ExecInitProjectSet(ProjectSet *node, EState *estate, int eflags)
#define nodeTag(nodeptr)
Definition: nodes.h:513
Definition: nodes.h:80
ForeignScanState * ExecInitForeignScan(ForeignScan *node, EState *estate, int eflags)
SeqScanState * ExecInitSeqScan(SeqScan *node, EState *estate, int eflags)
Definition: nodeSeqscan.c:163
List * initPlan
Definition: plannodes.h:133
Definition: nodes.h:78
LimitState * ExecInitLimit(Limit *node, EState *estate, int eflags)
Definition: nodeLimit.c:364
WorkTableScanState * ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags)
Definition: plannodes.h:730
#define elog
Definition: elog.h:219
Definition: pg_list.h:45
MaterialState * ExecInitMaterial(Material *node, EState *estate, int eflags)
Definition: nodeMaterial.c:163
Definition: nodes.h:82
TupleTableSlot* ExecProcNode ( PlanState node)

Definition at line 380 of file execProcnode.c.

References CHECK_FOR_INTERRUPTS, PlanState::chgParam, elog, ERROR, ExecAgg(), ExecAppend(), ExecBitmapHeapScan(), ExecCteScan(), ExecCustomScan(), ExecForeignScan(), ExecFunctionScan(), ExecGather(), ExecGroup(), ExecHash(), ExecHashJoin(), ExecIndexOnlyScan(), ExecIndexScan(), ExecLimit(), ExecLockRows(), ExecMaterial(), ExecMergeAppend(), ExecMergeJoin(), ExecModifyTable(), ExecNestLoop(), ExecProjectSet(), ExecRecursiveUnion(), ExecReScan(), ExecResult(), ExecSampleScan(), ExecSeqScan(), ExecSetOp(), ExecSort(), ExecSubqueryScan(), ExecTidScan(), ExecUnique(), ExecValuesScan(), ExecWindowAgg(), ExecWorkTableScan(), InstrStartNode(), InstrStopNode(), PlanState::instrument, nodeTag, NULL, T_AggState, T_AppendState, T_BitmapHeapScanState, T_CteScanState, T_CustomScanState, T_ForeignScanState, T_FunctionScanState, T_GatherState, T_GroupState, T_HashJoinState, T_HashState, T_IndexOnlyScanState, T_IndexScanState, T_LimitState, T_LockRowsState, T_MaterialState, T_MergeAppendState, T_MergeJoinState, T_ModifyTableState, T_NestLoopState, T_ProjectSetState, T_RecursiveUnionState, T_ResultState, T_SampleScanState, T_SeqScanState, T_SetOpState, T_SortState, T_SubqueryScanState, T_TidScanState, T_UniqueState, T_ValuesScanState, T_WindowAggState, T_WorkTableScanState, and TupIsNull.

Referenced by begin_partition(), buildSubPlanHash(), CteScanNext(), EvalPlanQualNext(), ExecAppend(), ExecGroup(), ExecHashJoin(), ExecHashJoinOuterGetTuple(), ExecLimit(), ExecLockRows(), ExecMaterial(), ExecMergeAppend(), ExecMergeJoin(), ExecModifyTable(), ExecNestLoop(), ExecPostprocessPlan(), ExecProjectSet(), ExecRecursiveUnion(), ExecResult(), ExecScanSubPlan(), ExecSetParamPlan(), ExecSort(), ExecUnique(), ExecutePlan(), fetch_input_tuple(), gather_getnext(), MultiExecHash(), postgresRecheckForeignScan(), setop_fill_hash_table(), setop_retrieve_direct(), spool_tuples(), and SubqueryNext().

381 {
382  TupleTableSlot *result;
383 
385 
386  if (node->chgParam != NULL) /* something changed */
387  ExecReScan(node); /* let ReScan handle this */
388 
389  if (node->instrument)
390  InstrStartNode(node->instrument);
391 
392  switch (nodeTag(node))
393  {
394  /*
395  * control nodes
396  */
397  case T_ResultState:
398  result = ExecResult((ResultState *) node);
399  break;
400 
401  case T_ProjectSetState:
402  result = ExecProjectSet((ProjectSetState *) node);
403  break;
404 
405  case T_ModifyTableState:
406  result = ExecModifyTable((ModifyTableState *) node);
407  break;
408 
409  case T_AppendState:
410  result = ExecAppend((AppendState *) node);
411  break;
412 
413  case T_MergeAppendState:
414  result = ExecMergeAppend((MergeAppendState *) node);
415  break;
416 
418  result = ExecRecursiveUnion((RecursiveUnionState *) node);
419  break;
420 
421  /* BitmapAndState does not yield tuples */
422 
423  /* BitmapOrState does not yield tuples */
424 
425  /*
426  * scan nodes
427  */
428  case T_SeqScanState:
429  result = ExecSeqScan((SeqScanState *) node);
430  break;
431 
432  case T_SampleScanState:
433  result = ExecSampleScan((SampleScanState *) node);
434  break;
435 
436  case T_IndexScanState:
437  result = ExecIndexScan((IndexScanState *) node);
438  break;
439 
441  result = ExecIndexOnlyScan((IndexOnlyScanState *) node);
442  break;
443 
444  /* BitmapIndexScanState does not yield tuples */
445 
447  result = ExecBitmapHeapScan((BitmapHeapScanState *) node);
448  break;
449 
450  case T_TidScanState:
451  result = ExecTidScan((TidScanState *) node);
452  break;
453 
454  case T_SubqueryScanState:
455  result = ExecSubqueryScan((SubqueryScanState *) node);
456  break;
457 
458  case T_FunctionScanState:
459  result = ExecFunctionScan((FunctionScanState *) node);
460  break;
461 
462  case T_ValuesScanState:
463  result = ExecValuesScan((ValuesScanState *) node);
464  break;
465 
466  case T_CteScanState:
467  result = ExecCteScan((CteScanState *) node);
468  break;
469 
471  result = ExecWorkTableScan((WorkTableScanState *) node);
472  break;
473 
474  case T_ForeignScanState:
475  result = ExecForeignScan((ForeignScanState *) node);
476  break;
477 
478  case T_CustomScanState:
479  result = ExecCustomScan((CustomScanState *) node);
480  break;
481 
482  /*
483  * join nodes
484  */
485  case T_NestLoopState:
486  result = ExecNestLoop((NestLoopState *) node);
487  break;
488 
489  case T_MergeJoinState:
490  result = ExecMergeJoin((MergeJoinState *) node);
491  break;
492 
493  case T_HashJoinState:
494  result = ExecHashJoin((HashJoinState *) node);
495  break;
496 
497  /*
498  * materialization nodes
499  */
500  case T_MaterialState:
501  result = ExecMaterial((MaterialState *) node);
502  break;
503 
504  case T_SortState:
505  result = ExecSort((SortState *) node);
506  break;
507 
508  case T_GroupState:
509  result = ExecGroup((GroupState *) node);
510  break;
511 
512  case T_AggState:
513  result = ExecAgg((AggState *) node);
514  break;
515 
516  case T_WindowAggState:
517  result = ExecWindowAgg((WindowAggState *) node);
518  break;
519 
520  case T_UniqueState:
521  result = ExecUnique((UniqueState *) node);
522  break;
523 
524  case T_GatherState:
525  result = ExecGather((GatherState *) node);
526  break;
527 
528  case T_HashState:
529  result = ExecHash((HashState *) node);
530  break;
531 
532  case T_SetOpState:
533  result = ExecSetOp((SetOpState *) node);
534  break;
535 
536  case T_LockRowsState:
537  result = ExecLockRows((LockRowsState *) node);
538  break;
539 
540  case T_LimitState:
541  result = ExecLimit((LimitState *) node);
542  break;
543 
544  default:
545  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
546  result = NULL;
547  break;
548  }
549 
550  if (node->instrument)
551  InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
552 
553  return result;
554 }
void InstrStopNode(Instrumentation *instr, double nTuples)
Definition: instrument.c:80
TupleTableSlot * ExecModifyTable(ModifyTableState *node)
TupleTableSlot * ExecTidScan(TidScanState *node)
Definition: nodeTidscan.c:389
TupleTableSlot * ExecSampleScan(SampleScanState *node)
TupleTableSlot * ExecValuesScan(ValuesScanState *node)
Instrumentation * instrument
Definition: execnodes.h:1053
TupleTableSlot * ExecGroup(GroupState *node)
Definition: nodeGroup.c:35
TupleTableSlot * ExecAgg(AggState *node)
Definition: nodeAgg.c:1899
void ExecReScan(PlanState *node)
Definition: execAmi.c:73
TupleTableSlot * ExecRecursiveUnion(RecursiveUnionState *node)
TupleTableSlot * ExecFunctionScan(FunctionScanState *node)
TupleTableSlot * ExecResult(ResultState *node)
Definition: nodeResult.c:67
TupleTableSlot * ExecIndexOnlyScan(IndexOnlyScanState *node)
TupleTableSlot * ExecCustomScan(CustomScanState *node)
Definition: nodeCustom.c:109
TupleTableSlot * ExecMaterial(MaterialState *node)
Definition: nodeMaterial.c:39
TupleTableSlot * ExecIndexScan(IndexScanState *node)
TupleTableSlot * ExecWindowAgg(WindowAggState *winstate)
#define ERROR
Definition: elog.h:43
TupleTableSlot * ExecForeignScan(ForeignScanState *node)
void InstrStartNode(Instrumentation *instr)
Definition: instrument.c:63
TupleTableSlot * ExecMergeAppend(MergeAppendState *node)
TupleTableSlot * ExecSubqueryScan(SubqueryScanState *node)
TupleTableSlot * ExecLockRows(LockRowsState *node)
Definition: nodeLockRows.c:39
#define TupIsNull(slot)
Definition: tuptable.h:138
TupleTableSlot * ExecNestLoop(NestLoopState *node)
Definition: nodeNestloop.c:60
TupleTableSlot * ExecProjectSet(ProjectSetState *node)
Bitmapset * chgParam
Definition: execnodes.h:1072
TupleTableSlot * ExecWorkTableScan(WorkTableScanState *node)
TupleTableSlot * ExecLimit(LimitState *node)
Definition: nodeLimit.c:40
#define NULL
Definition: c.h:226
TupleTableSlot * ExecMergeJoin(MergeJoinState *node)
TupleTableSlot * ExecBitmapHeapScan(BitmapHeapScanState *node)
#define nodeTag(nodeptr)
Definition: nodes.h:513
TupleTableSlot * ExecUnique(UniqueState *node)
Definition: nodeUnique.c:46
TupleTableSlot * ExecSeqScan(SeqScanState *node)
Definition: nodeSeqscan.c:125
TupleTableSlot * ExecHashJoin(HashJoinState *node)
Definition: nodeHashjoin.c:62
TupleTableSlot * ExecGather(GatherState *node)
Definition: nodeGather.c:128
TupleTableSlot * ExecSetOp(SetOpState *node)
Definition: nodeSetOp.c:183
TupleTableSlot * ExecCteScan(CteScanState *node)
Definition: nodeCtescan.c:153
TupleTableSlot * ExecSort(SortState *node)
Definition: nodeSort.c:39
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:97
#define elog
Definition: elog.h:219
TupleTableSlot * ExecHash(HashState *node)
Definition: nodeHash.c:60
TupleTableSlot * ExecAppend(AppendState *node)
Definition: nodeAppend.c:194
bool ExecShutdownNode ( PlanState node)

Definition at line 813 of file execProcnode.c.

References ExecShutdownGather(), ExecShutdownNode(), nodeTag, NULL, planstate_tree_walker(), and T_GatherState.

Referenced by ExecShutdownNode(), and ExecutePlan().

814 {
815  if (node == NULL)
816  return false;
817 
819 
820  switch (nodeTag(node))
821  {
822  case T_GatherState:
824  break;
825  default:
826  break;
827  }
828 
829  return false;
830 }
bool ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:813
void ExecShutdownGather(GatherState *node)
Definition: nodeGather.c:404
#define NULL
Definition: c.h:226
#define nodeTag(nodeptr)
Definition: nodes.h:513
bool planstate_tree_walker(PlanState *planstate, bool(*walker)(), void *context)
Definition: nodeFuncs.c:3639
Node* MultiExecProcNode ( PlanState node)

Definition at line 571 of file execProcnode.c.

References CHECK_FOR_INTERRUPTS, PlanState::chgParam, elog, ERROR, ExecReScan(), MultiExecBitmapAnd(), MultiExecBitmapIndexScan(), MultiExecBitmapOr(), MultiExecHash(), nodeTag, NULL, T_BitmapAndState, T_BitmapIndexScanState, T_BitmapOrState, and T_HashState.

Referenced by BitmapHeapNext(), ExecHashJoin(), MultiExecBitmapAnd(), and MultiExecBitmapOr().

572 {
573  Node *result;
574 
576 
577  if (node->chgParam != NULL) /* something changed */
578  ExecReScan(node); /* let ReScan handle this */
579 
580  switch (nodeTag(node))
581  {
582  /*
583  * Only node types that actually support multiexec will be listed
584  */
585 
586  case T_HashState:
587  result = MultiExecHash((HashState *) node);
588  break;
589 
592  break;
593 
594  case T_BitmapAndState:
595  result = MultiExecBitmapAnd((BitmapAndState *) node);
596  break;
597 
598  case T_BitmapOrState:
599  result = MultiExecBitmapOr((BitmapOrState *) node);
600  break;
601 
602  default:
603  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
604  result = NULL;
605  break;
606  }
607 
608  return result;
609 }
void ExecReScan(PlanState *node)
Definition: execAmi.c:73
Definition: nodes.h:508
Node * MultiExecHash(HashState *node)
Definition: nodeHash.c:74
#define ERROR
Definition: elog.h:43
Node * MultiExecBitmapIndexScan(BitmapIndexScanState *node)
Bitmapset * chgParam
Definition: execnodes.h:1072
Node * MultiExecBitmapAnd(BitmapAndState *node)
Definition: nodeBitmapAnd.c:96
Node * MultiExecBitmapOr(BitmapOrState *node)
Definition: nodeBitmapOr.c:97
#define NULL
Definition: c.h:226
#define nodeTag(nodeptr)
Definition: nodes.h:513
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:97
#define elog
Definition: elog.h:219