PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
execProcnode.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * execProcnode.c
4  * contains dispatch functions which call the appropriate "initialize",
5  * "get a tuple", and "cleanup" routines for the given node type.
6  * If the node has children, then it will presumably call ExecInitNode,
7  * ExecProcNode, or ExecEndNode on its subnodes and do the appropriate
8  * processing.
9  *
10  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
11  * Portions Copyright (c) 1994, Regents of the University of California
12  *
13  *
14  * IDENTIFICATION
15  * src/backend/executor/execProcnode.c
16  *
17  *-------------------------------------------------------------------------
18  */
19 /*
20  * INTERFACE ROUTINES
21  * ExecInitNode - initialize a plan node and its subplans
22  * ExecProcNode - get a tuple by executing the plan node
23  * ExecEndNode - shut down a plan node and its subplans
24  *
25  * NOTES
26  * This used to be three files. It is now all combined into
27  * one file so that it is easier to keep ExecInitNode, ExecProcNode,
28  * and ExecEndNode in sync when new nodes are added.
29  *
30  * EXAMPLE
31  * Suppose we want the age of the manager of the shoe department and
32  * the number of employees in that department. So we have the query:
33  *
34  * select DEPT.no_emps, EMP.age
35  * from DEPT, EMP
36  * where EMP.name = DEPT.mgr and
37  * DEPT.name = "shoe"
38  *
39  * Suppose the planner gives us the following plan:
40  *
41  * Nest Loop (DEPT.mgr = EMP.name)
42  * / \
43  * / \
44  * Seq Scan Seq Scan
45  * DEPT EMP
46  * (name = "shoe")
47  *
48  * ExecutorStart() is called first.
49  * It calls InitPlan() which calls ExecInitNode() on
50  * the root of the plan -- the nest loop node.
51  *
52  * * ExecInitNode() notices that it is looking at a nest loop and
53  * as the code below demonstrates, it calls ExecInitNestLoop().
54  * Eventually this calls ExecInitNode() on the right and left subplans
55  * and so forth until the entire plan is initialized. The result
56  * of ExecInitNode() is a plan state tree built with the same structure
57  * as the underlying plan tree.
58  *
59  * * Then when ExecutorRun() is called, it calls ExecutePlan() which calls
60  * ExecProcNode() repeatedly on the top node of the plan state tree.
61  * Each time this happens, ExecProcNode() will end up calling
62  * ExecNestLoop(), which calls ExecProcNode() on its subplans.
63  * Each of these subplans is a sequential scan so ExecSeqScan() is
64  * called. The slots returned by ExecSeqScan() may contain
65  * tuples which contain the attributes ExecNestLoop() uses to
66  * form the tuples it returns.
67  *
68  * * Eventually ExecSeqScan() stops returning tuples and the nest
69  * loop join ends. Lastly, ExecutorEnd() calls ExecEndNode() which
70  * calls ExecEndNestLoop() which in turn calls ExecEndNode() on
71  * its subplans which result in ExecEndSeqScan().
72  *
73  * This should show how the executor works by having
74  * ExecInitNode(), ExecProcNode() and ExecEndNode() dispatch
75  * their work to the appropriate node support routines which may
76  * in turn call these routines themselves on their subplans.
77  */
78 #include "postgres.h"
79 
80 #include "executor/executor.h"
81 #include "executor/nodeAgg.h"
82 #include "executor/nodeAppend.h"
83 #include "executor/nodeBitmapAnd.h"
86 #include "executor/nodeBitmapOr.h"
87 #include "executor/nodeCtescan.h"
88 #include "executor/nodeCustom.h"
91 #include "executor/nodeGather.h"
93 #include "executor/nodeGroup.h"
94 #include "executor/nodeHash.h"
95 #include "executor/nodeHashjoin.h"
97 #include "executor/nodeIndexscan.h"
98 #include "executor/nodeLimit.h"
99 #include "executor/nodeLockRows.h"
100 #include "executor/nodeMaterial.h"
102 #include "executor/nodeMergejoin.h"
104 #include "executor/nodeNestloop.h"
105 #include "executor/nodeProjectSet.h"
107 #include "executor/nodeResult.h"
108 #include "executor/nodeSamplescan.h"
109 #include "executor/nodeSeqscan.h"
110 #include "executor/nodeSetOp.h"
111 #include "executor/nodeSort.h"
112 #include "executor/nodeSubplan.h"
115 #include "executor/nodeTidscan.h"
116 #include "executor/nodeUnique.h"
117 #include "executor/nodeValuesscan.h"
118 #include "executor/nodeWindowAgg.h"
120 #include "nodes/nodeFuncs.h"
121 #include "miscadmin.h"
122 
123 
124 /* ------------------------------------------------------------------------
125  * ExecInitNode
126  *
127  * Recursively initializes all the nodes in the plan tree rooted
128  * at 'node'.
129  *
130  * Inputs:
131  * 'node' is the current node of the plan produced by the query planner
132  * 'estate' is the shared execution state for the plan tree
133  * 'eflags' is a bitwise OR of flag bits described in executor.h
134  *
135  * Returns a PlanState node corresponding to the given Plan node.
136  * ------------------------------------------------------------------------
137  */
138 PlanState *
139 ExecInitNode(Plan *node, EState *estate, int eflags)
140 {
141  PlanState *result;
142  List *subps;
143  ListCell *l;
144 
145  /*
146  * do nothing when we get to the end of a leaf on tree.
147  */
148  if (node == NULL)
149  return NULL;
150 
151  switch (nodeTag(node))
152  {
153  /*
154  * control nodes
155  */
156  case T_Result:
157  result = (PlanState *) ExecInitResult((Result *) node,
158  estate, eflags);
159  break;
160 
161  case T_ProjectSet:
162  result = (PlanState *) ExecInitProjectSet((ProjectSet *) node,
163  estate, eflags);
164  break;
165 
166  case T_ModifyTable:
167  result = (PlanState *) ExecInitModifyTable((ModifyTable *) node,
168  estate, eflags);
169  break;
170 
171  case T_Append:
172  result = (PlanState *) ExecInitAppend((Append *) node,
173  estate, eflags);
174  break;
175 
176  case T_MergeAppend:
177  result = (PlanState *) ExecInitMergeAppend((MergeAppend *) node,
178  estate, eflags);
179  break;
180 
181  case T_RecursiveUnion:
182  result = (PlanState *) ExecInitRecursiveUnion((RecursiveUnion *) node,
183  estate, eflags);
184  break;
185 
186  case T_BitmapAnd:
187  result = (PlanState *) ExecInitBitmapAnd((BitmapAnd *) node,
188  estate, eflags);
189  break;
190 
191  case T_BitmapOr:
192  result = (PlanState *) ExecInitBitmapOr((BitmapOr *) node,
193  estate, eflags);
194  break;
195 
196  /*
197  * scan nodes
198  */
199  case T_SeqScan:
200  result = (PlanState *) ExecInitSeqScan((SeqScan *) node,
201  estate, eflags);
202  break;
203 
204  case T_SampleScan:
205  result = (PlanState *) ExecInitSampleScan((SampleScan *) node,
206  estate, eflags);
207  break;
208 
209  case T_IndexScan:
210  result = (PlanState *) ExecInitIndexScan((IndexScan *) node,
211  estate, eflags);
212  break;
213 
214  case T_IndexOnlyScan:
215  result = (PlanState *) ExecInitIndexOnlyScan((IndexOnlyScan *) node,
216  estate, eflags);
217  break;
218 
219  case T_BitmapIndexScan:
220  result = (PlanState *) ExecInitBitmapIndexScan((BitmapIndexScan *) node,
221  estate, eflags);
222  break;
223 
224  case T_BitmapHeapScan:
225  result = (PlanState *) ExecInitBitmapHeapScan((BitmapHeapScan *) node,
226  estate, eflags);
227  break;
228 
229  case T_TidScan:
230  result = (PlanState *) ExecInitTidScan((TidScan *) node,
231  estate, eflags);
232  break;
233 
234  case T_SubqueryScan:
235  result = (PlanState *) ExecInitSubqueryScan((SubqueryScan *) node,
236  estate, eflags);
237  break;
238 
239  case T_FunctionScan:
240  result = (PlanState *) ExecInitFunctionScan((FunctionScan *) node,
241  estate, eflags);
242  break;
243 
244  case T_TableFuncScan:
245  result = (PlanState *) ExecInitTableFuncScan((TableFuncScan *) node,
246  estate, eflags);
247  break;
248 
249  case T_ValuesScan:
250  result = (PlanState *) ExecInitValuesScan((ValuesScan *) node,
251  estate, eflags);
252  break;
253 
254  case T_CteScan:
255  result = (PlanState *) ExecInitCteScan((CteScan *) node,
256  estate, eflags);
257  break;
258 
259  case T_WorkTableScan:
260  result = (PlanState *) ExecInitWorkTableScan((WorkTableScan *) node,
261  estate, eflags);
262  break;
263 
264  case T_ForeignScan:
265  result = (PlanState *) ExecInitForeignScan((ForeignScan *) node,
266  estate, eflags);
267  break;
268 
269  case T_CustomScan:
270  result = (PlanState *) ExecInitCustomScan((CustomScan *) node,
271  estate, eflags);
272  break;
273 
274  /*
275  * join nodes
276  */
277  case T_NestLoop:
278  result = (PlanState *) ExecInitNestLoop((NestLoop *) node,
279  estate, eflags);
280  break;
281 
282  case T_MergeJoin:
283  result = (PlanState *) ExecInitMergeJoin((MergeJoin *) node,
284  estate, eflags);
285  break;
286 
287  case T_HashJoin:
288  result = (PlanState *) ExecInitHashJoin((HashJoin *) node,
289  estate, eflags);
290  break;
291 
292  /*
293  * materialization nodes
294  */
295  case T_Material:
296  result = (PlanState *) ExecInitMaterial((Material *) node,
297  estate, eflags);
298  break;
299 
300  case T_Sort:
301  result = (PlanState *) ExecInitSort((Sort *) node,
302  estate, eflags);
303  break;
304 
305  case T_Group:
306  result = (PlanState *) ExecInitGroup((Group *) node,
307  estate, eflags);
308  break;
309 
310  case T_Agg:
311  result = (PlanState *) ExecInitAgg((Agg *) node,
312  estate, eflags);
313  break;
314 
315  case T_WindowAgg:
316  result = (PlanState *) ExecInitWindowAgg((WindowAgg *) node,
317  estate, eflags);
318  break;
319 
320  case T_Unique:
321  result = (PlanState *) ExecInitUnique((Unique *) node,
322  estate, eflags);
323  break;
324 
325  case T_Gather:
326  result = (PlanState *) ExecInitGather((Gather *) node,
327  estate, eflags);
328  break;
329 
330  case T_GatherMerge:
331  result = (PlanState *) ExecInitGatherMerge((GatherMerge *) node,
332  estate, eflags);
333  break;
334 
335  case T_Hash:
336  result = (PlanState *) ExecInitHash((Hash *) node,
337  estate, eflags);
338  break;
339 
340  case T_SetOp:
341  result = (PlanState *) ExecInitSetOp((SetOp *) node,
342  estate, eflags);
343  break;
344 
345  case T_LockRows:
346  result = (PlanState *) ExecInitLockRows((LockRows *) node,
347  estate, eflags);
348  break;
349 
350  case T_Limit:
351  result = (PlanState *) ExecInitLimit((Limit *) node,
352  estate, eflags);
353  break;
354 
355  default:
356  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
357  result = NULL; /* keep compiler quiet */
358  break;
359  }
360 
361  /*
362  * Initialize any initPlans present in this node. The planner put them in
363  * a separate list for us.
364  */
365  subps = NIL;
366  foreach(l, node->initPlan)
367  {
368  SubPlan *subplan = (SubPlan *) lfirst(l);
369  SubPlanState *sstate;
370 
371  Assert(IsA(subplan, SubPlan));
372  sstate = ExecInitSubPlan(subplan, result);
373  subps = lappend(subps, sstate);
374  }
375  result->initPlan = subps;
376 
377  /* Set up instrumentation for this node if requested */
378  if (estate->es_instrument)
379  result->instrument = InstrAlloc(1, estate->es_instrument);
380 
381  return result;
382 }
383 
384 
385 /* ----------------------------------------------------------------
386  * ExecProcNode
387  *
388  * Execute the given node to return a(nother) tuple.
389  * ----------------------------------------------------------------
390  */
393 {
395 
397 
398  if (node->chgParam != NULL) /* something changed */
399  ExecReScan(node); /* let ReScan handle this */
400 
401  if (node->instrument)
402  InstrStartNode(node->instrument);
403 
404  switch (nodeTag(node))
405  {
406  /*
407  * control nodes
408  */
409  case T_ResultState:
410  result = ExecResult((ResultState *) node);
411  break;
412 
413  case T_ProjectSetState:
414  result = ExecProjectSet((ProjectSetState *) node);
415  break;
416 
417  case T_ModifyTableState:
418  result = ExecModifyTable((ModifyTableState *) node);
419  break;
420 
421  case T_AppendState:
422  result = ExecAppend((AppendState *) node);
423  break;
424 
425  case T_MergeAppendState:
426  result = ExecMergeAppend((MergeAppendState *) node);
427  break;
428 
430  result = ExecRecursiveUnion((RecursiveUnionState *) node);
431  break;
432 
433  /* BitmapAndState does not yield tuples */
434 
435  /* BitmapOrState does not yield tuples */
436 
437  /*
438  * scan nodes
439  */
440  case T_SeqScanState:
441  result = ExecSeqScan((SeqScanState *) node);
442  break;
443 
444  case T_SampleScanState:
445  result = ExecSampleScan((SampleScanState *) node);
446  break;
447 
448  case T_IndexScanState:
449  result = ExecIndexScan((IndexScanState *) node);
450  break;
451 
453  result = ExecIndexOnlyScan((IndexOnlyScanState *) node);
454  break;
455 
456  /* BitmapIndexScanState does not yield tuples */
457 
459  result = ExecBitmapHeapScan((BitmapHeapScanState *) node);
460  break;
461 
462  case T_TidScanState:
463  result = ExecTidScan((TidScanState *) node);
464  break;
465 
466  case T_SubqueryScanState:
467  result = ExecSubqueryScan((SubqueryScanState *) node);
468  break;
469 
470  case T_FunctionScanState:
471  result = ExecFunctionScan((FunctionScanState *) node);
472  break;
473 
475  result = ExecTableFuncScan((TableFuncScanState *) node);
476  break;
477 
478  case T_ValuesScanState:
479  result = ExecValuesScan((ValuesScanState *) node);
480  break;
481 
482  case T_CteScanState:
483  result = ExecCteScan((CteScanState *) node);
484  break;
485 
487  result = ExecWorkTableScan((WorkTableScanState *) node);
488  break;
489 
490  case T_ForeignScanState:
491  result = ExecForeignScan((ForeignScanState *) node);
492  break;
493 
494  case T_CustomScanState:
495  result = ExecCustomScan((CustomScanState *) node);
496  break;
497 
498  /*
499  * join nodes
500  */
501  case T_NestLoopState:
502  result = ExecNestLoop((NestLoopState *) node);
503  break;
504 
505  case T_MergeJoinState:
506  result = ExecMergeJoin((MergeJoinState *) node);
507  break;
508 
509  case T_HashJoinState:
510  result = ExecHashJoin((HashJoinState *) node);
511  break;
512 
513  /*
514  * materialization nodes
515  */
516  case T_MaterialState:
517  result = ExecMaterial((MaterialState *) node);
518  break;
519 
520  case T_SortState:
521  result = ExecSort((SortState *) node);
522  break;
523 
524  case T_GroupState:
525  result = ExecGroup((GroupState *) node);
526  break;
527 
528  case T_AggState:
529  result = ExecAgg((AggState *) node);
530  break;
531 
532  case T_WindowAggState:
533  result = ExecWindowAgg((WindowAggState *) node);
534  break;
535 
536  case T_UniqueState:
537  result = ExecUnique((UniqueState *) node);
538  break;
539 
540  case T_GatherState:
541  result = ExecGather((GatherState *) node);
542  break;
543 
544  case T_GatherMergeState:
545  result = ExecGatherMerge((GatherMergeState *) node);
546  break;
547 
548  case T_HashState:
549  result = ExecHash((HashState *) node);
550  break;
551 
552  case T_SetOpState:
553  result = ExecSetOp((SetOpState *) node);
554  break;
555 
556  case T_LockRowsState:
557  result = ExecLockRows((LockRowsState *) node);
558  break;
559 
560  case T_LimitState:
561  result = ExecLimit((LimitState *) node);
562  break;
563 
564  default:
565  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
566  result = NULL;
567  break;
568  }
569 
570  if (node->instrument)
571  InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
572 
573  return result;
574 }
575 
576 
577 /* ----------------------------------------------------------------
578  * MultiExecProcNode
579  *
580  * Execute a node that doesn't return individual tuples
581  * (it might return a hashtable, bitmap, etc). Caller should
582  * check it got back the expected kind of Node.
583  *
584  * This has essentially the same responsibilities as ExecProcNode,
585  * but it does not do InstrStartNode/InstrStopNode (mainly because
586  * it can't tell how many returned tuples to count). Each per-node
587  * function must provide its own instrumentation support.
588  * ----------------------------------------------------------------
589  */
590 Node *
592 {
593  Node *result;
594 
596 
597  if (node->chgParam != NULL) /* something changed */
598  ExecReScan(node); /* let ReScan handle this */
599 
600  switch (nodeTag(node))
601  {
602  /*
603  * Only node types that actually support multiexec will be listed
604  */
605 
606  case T_HashState:
607  result = MultiExecHash((HashState *) node);
608  break;
609 
612  break;
613 
614  case T_BitmapAndState:
615  result = MultiExecBitmapAnd((BitmapAndState *) node);
616  break;
617 
618  case T_BitmapOrState:
619  result = MultiExecBitmapOr((BitmapOrState *) node);
620  break;
621 
622  default:
623  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
624  result = NULL;
625  break;
626  }
627 
628  return result;
629 }
630 
631 
632 /* ----------------------------------------------------------------
633  * ExecEndNode
634  *
635  * Recursively cleans up all the nodes in the plan rooted
636  * at 'node'.
637  *
638  * After this operation, the query plan will not be able to be
639  * processed any further. This should be called only after
640  * the query plan has been fully executed.
641  * ----------------------------------------------------------------
642  */
643 void
645 {
646  /*
647  * do nothing when we get to the end of a leaf on tree.
648  */
649  if (node == NULL)
650  return;
651 
652  if (node->chgParam != NULL)
653  {
654  bms_free(node->chgParam);
655  node->chgParam = NULL;
656  }
657 
658  switch (nodeTag(node))
659  {
660  /*
661  * control nodes
662  */
663  case T_ResultState:
664  ExecEndResult((ResultState *) node);
665  break;
666 
667  case T_ProjectSetState:
669  break;
670 
671  case T_ModifyTableState:
673  break;
674 
675  case T_AppendState:
676  ExecEndAppend((AppendState *) node);
677  break;
678 
679  case T_MergeAppendState:
681  break;
682 
685  break;
686 
687  case T_BitmapAndState:
689  break;
690 
691  case T_BitmapOrState:
692  ExecEndBitmapOr((BitmapOrState *) node);
693  break;
694 
695  /*
696  * scan nodes
697  */
698  case T_SeqScanState:
699  ExecEndSeqScan((SeqScanState *) node);
700  break;
701 
702  case T_SampleScanState:
704  break;
705 
706  case T_GatherState:
707  ExecEndGather((GatherState *) node);
708  break;
709 
710  case T_GatherMergeState:
712  break;
713 
714  case T_IndexScanState:
716  break;
717 
720  break;
721 
724  break;
725 
728  break;
729 
730  case T_TidScanState:
731  ExecEndTidScan((TidScanState *) node);
732  break;
733 
734  case T_SubqueryScanState:
736  break;
737 
738  case T_FunctionScanState:
740  break;
741 
744  break;
745 
746  case T_ValuesScanState:
748  break;
749 
750  case T_CteScanState:
751  ExecEndCteScan((CteScanState *) node);
752  break;
753 
756  break;
757 
758  case T_ForeignScanState:
760  break;
761 
762  case T_CustomScanState:
764  break;
765 
766  /*
767  * join nodes
768  */
769  case T_NestLoopState:
770  ExecEndNestLoop((NestLoopState *) node);
771  break;
772 
773  case T_MergeJoinState:
775  break;
776 
777  case T_HashJoinState:
778  ExecEndHashJoin((HashJoinState *) node);
779  break;
780 
781  /*
782  * materialization nodes
783  */
784  case T_MaterialState:
785  ExecEndMaterial((MaterialState *) node);
786  break;
787 
788  case T_SortState:
789  ExecEndSort((SortState *) node);
790  break;
791 
792  case T_GroupState:
793  ExecEndGroup((GroupState *) node);
794  break;
795 
796  case T_AggState:
797  ExecEndAgg((AggState *) node);
798  break;
799 
800  case T_WindowAggState:
802  break;
803 
804  case T_UniqueState:
805  ExecEndUnique((UniqueState *) node);
806  break;
807 
808  case T_HashState:
809  ExecEndHash((HashState *) node);
810  break;
811 
812  case T_SetOpState:
813  ExecEndSetOp((SetOpState *) node);
814  break;
815 
816  case T_LockRowsState:
817  ExecEndLockRows((LockRowsState *) node);
818  break;
819 
820  case T_LimitState:
821  ExecEndLimit((LimitState *) node);
822  break;
823 
824  default:
825  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
826  break;
827  }
828 }
829 
830 /*
831  * ExecShutdownNode
832  *
833  * Give execution nodes a chance to stop asynchronous resource consumption
834  * and release any resources still held. Currently, this is only used for
835  * parallel query, but we might want to extend it to other cases also (e.g.
836  * FDW). We might also want to call it sooner, as soon as it's evident that
837  * no more rows will be needed (e.g. when a Limit is filled) rather than only
838  * at the end of ExecutorRun.
839  */
840 bool
842 {
843  if (node == NULL)
844  return false;
845 
847 
848  switch (nodeTag(node))
849  {
850  case T_GatherState:
852  break;
853  case T_ForeignScanState:
855  break;
856  case T_CustomScanState:
858  break;
859  case T_GatherMergeState:
861  break;
862  default:
863  break;
864  }
865 
866  return false;
867 }
void ExecEndGroup(GroupState *node)
Definition: nodeGroup.c:226
MergeJoinState * ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags)
void ExecEndSetOp(SetOpState *node)
Definition: nodeSetOp.c:575
#define NIL
Definition: pg_list.h:69
void InstrStopNode(Instrumentation *instr, double nTuples)
Definition: instrument.c:80
void ExecEndFunctionScan(FunctionScanState *node)
TupleTableSlot * ExecModifyTable(ModifyTableState *node)
TupleTableSlot * ExecTidScan(TidScanState *node)
Definition: nodeTidscan.c:446
TupleTableSlot * ExecTableFuncScan(TableFuncScanState *node)
Definition: nodes.h:76
SortState * ExecInitSort(Sort *node, EState *estate, int eflags)
Definition: nodeSort.c:152
TupleTableSlot * ExecProcNode(PlanState *node)
Definition: execProcnode.c:392
#define IsA(nodeptr, _type_)
Definition: nodes.h:557
void ExecEndNestLoop(NestLoopState *node)
Definition: nodeNestloop.c:353
TupleTableSlot * ExecSampleScan(SampleScanState *node)
BitmapHeapScanState * ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
TupleTableSlot * ExecValuesScan(ValuesScanState *node)
Definition: nodes.h:78
Instrumentation * instrument
Definition: execnodes.h:806
void ExecEndIndexScan(IndexScanState *node)
TupleTableSlot * ExecGroup(GroupState *node)
Definition: nodeGroup.c:35
void ExecEndLimit(LimitState *node)
Definition: nodeLimit.c:426
TupleTableSlot * ExecAgg(AggState *node)
Definition: nodeAgg.c:2096
GroupState * ExecInitGroup(Group *node, EState *estate, int eflags)
Definition: nodeGroup.c:162
MergeAppendState * ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags)
void ExecEndUnique(UniqueState *node)
Definition: nodeUnique.c:173
void ExecEndGatherMerge(GatherMergeState *node)
bool ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:841
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:644
void ExecShutdownCustomScan(CustomScanState *node)
Definition: nodeCustom.c:203
GatherMergeState * ExecInitGatherMerge(GatherMerge *node, EState *estate, int eflags)
List * initPlan
Definition: execnodes.h:817
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
void ExecEndWorkTableScan(WorkTableScanState *node)
void ExecReScan(PlanState *node)
Definition: execAmi.c:74
void ExecEndLockRows(LockRowsState *node)
Definition: nodeLockRows.c:446
TupleTableSlot * ExecRecursiveUnion(RecursiveUnionState *node)
TupleTableSlot * ExecFunctionScan(FunctionScanState *node)
void ExecEndBitmapAnd(BitmapAndState *node)
CteScanState * ExecInitCteScan(CteScan *node, EState *estate, int eflags)
Definition: nodeCtescan.c:166
Definition: nodes.h:506
Definition: nodes.h:48
Instrumentation * InstrAlloc(int n, int instrument_options)
Definition: instrument.c:30
Node * MultiExecHash(HashState *node)
Definition: nodeHash.c:74
AppendState * ExecInitAppend(Append *node, EState *estate, int eflags)
Definition: nodeAppend.c:120
TupleTableSlot * ExecResult(ResultState *node)
Definition: nodeResult.c:67
return result
Definition: formatting.c:1618
Definition: nodes.h:74
GatherState * ExecInitGather(Gather *node, EState *estate, int eflags)
Definition: nodeGather.c:56
TupleTableSlot * ExecGatherMerge(GatherMergeState *node)
void ExecEndRecursiveUnion(RecursiveUnionState *node)
SubPlanState * ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
Definition: nodeSubplan.c:686
void ExecEndSubqueryScan(SubqueryScanState *node)
void ExecEndHashJoin(HashJoinState *node)
Definition: nodeHashjoin.c:541
TupleTableSlot * ExecIndexOnlyScan(IndexOnlyScanState *node)
TupleTableSlot * ExecCustomScan(CustomScanState *node)
Definition: nodeCustom.c:105
TupleTableSlot * ExecMaterial(MaterialState *node)
Definition: nodeMaterial.c:39
void ExecEndTableFuncScan(TableFuncScanState *node)
TupleTableSlot * ExecIndexScan(IndexScanState *node)
void ExecEndResult(ResultState *node)
Definition: nodeResult.c:241
AggState * ExecInitAgg(Agg *node, EState *estate, int eflags)
Definition: nodeAgg.c:2655
TidScanState * ExecInitTidScan(TidScan *node, EState *estate, int eflags)
Definition: nodeTidscan.c:508
TupleTableSlot * ExecWindowAgg(WindowAggState *winstate)
Definition: nodes.h:45
#define ERROR
Definition: elog.h:43
TupleTableSlot * ExecForeignScan(ForeignScanState *node)
IndexScanState * ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
void ExecEndAppend(AppendState *node)
Definition: nodeAppend.c:252
void InstrStartNode(Instrumentation *instr)
Definition: instrument.c:63
CustomScanState * ExecInitCustomScan(CustomScan *cscan, EState *estate, int eflags)
Definition: nodeCustom.c:24
void ExecEndForeignScan(ForeignScanState *node)
void ExecEndSort(SortState *node)
Definition: nodeSort.c:223
BitmapIndexScanState * ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
Definition: nodes.h:75
TupleTableSlot * ExecMergeAppend(MergeAppendState *node)
TupleTableSlot * ExecSubqueryScan(SubqueryScanState *node)
SampleScanState * ExecInitSampleScan(SampleScan *node, EState *estate, int eflags)
void ExecEndBitmapIndexScan(BitmapIndexScanState *node)
TupleTableSlot * ExecLockRows(LockRowsState *node)
Definition: nodeLockRows.c:39
void ExecEndValuesScan(ValuesScanState *node)
void ExecEndMergeJoin(MergeJoinState *node)
Node * MultiExecBitmapIndexScan(BitmapIndexScanState *node)
#define TupIsNull(slot)
Definition: tuptable.h:138
void ExecEndSeqScan(SeqScanState *node)
Definition: nodeSeqscan.c:221
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
int es_instrument
Definition: execnodes.h:445
void ExecEndIndexOnlyScan(IndexOnlyScanState *node)
TupleTableSlot * ExecNestLoop(NestLoopState *node)
Definition: nodeNestloop.c:60
FunctionScanState * ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
void ExecEndTidScan(TidScanState *node)
Definition: nodeTidscan.c:477
TupleTableSlot * ExecProjectSet(ProjectSetState *node)
Bitmapset * chgParam
Definition: execnodes.h:824
List * lappend(List *list, void *datum)
Definition: list.c:128
Node * MultiExecBitmapAnd(BitmapAndState *node)
Definition: nodeBitmapAnd.c:96
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:381
Node * MultiExecBitmapOr(BitmapOrState *node)
Definition: nodeBitmapOr.c:97
void ExecShutdownGather(GatherState *node)
Definition: nodeGather.c:400
void ExecEndCteScan(CteScanState *node)
Definition: nodeCtescan.c:277
void ExecEndCustomScan(CustomScanState *node)
Definition: nodeCustom.c:112
UniqueState * ExecInitUnique(Unique *node, EState *estate, int eflags)
Definition: nodeUnique.c:112
TupleTableSlot * ExecWorkTableScan(WorkTableScanState *node)
void ExecEndBitmapOr(BitmapOrState *node)
Definition: nodeBitmapOr.c:182
Definition: nodes.h:81
TupleTableSlot * ExecLimit(LimitState *node)
Definition: nodeLimit.c:40
void ExecEndSampleScan(SampleScanState *node)
void ExecShutdownGatherMerge(GatherMergeState *node)
void bms_free(Bitmapset *a)
Definition: bitmapset.c:201
void ExecEndWindowAgg(WindowAggState *node)
BitmapOrState * ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags)
Definition: nodeBitmapOr.c:43
#define NULL
Definition: c.h:229
IndexOnlyScanState * ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags)
#define Assert(condition)
Definition: c.h:675
#define lfirst(lc)
Definition: pg_list.h:106
void ExecEndMergeAppend(MergeAppendState *node)
TupleTableSlot * ExecMergeJoin(MergeJoinState *node)
ResultState * ExecInitResult(Result *node, EState *estate, int eflags)
Definition: nodeResult.c:177
TupleTableSlot * ExecBitmapHeapScan(BitmapHeapScanState *node)
WindowAggState * ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
ProjectSetState * ExecInitProjectSet(ProjectSet *node, EState *estate, int eflags)
#define nodeTag(nodeptr)
Definition: nodes.h:511
TupleTableSlot * ExecUnique(UniqueState *node)
Definition: nodeUnique.c:46
TupleTableSlot * ExecSeqScan(SeqScanState *node)
Definition: nodeSeqscan.c:125
TupleTableSlot * ExecHashJoin(HashJoinState *node)
Definition: nodeHashjoin.c:62
Definition: nodes.h:82
TupleTableSlot * ExecGather(GatherState *node)
Definition: nodeGather.c:124
TupleTableSlot * ExecSetOp(SetOpState *node)
Definition: nodeSetOp.c:183
TableFuncScanState * ExecInitTableFuncScan(TableFuncScan *node, EState *estate, int eflags)
ForeignScanState * ExecInitForeignScan(ForeignScan *node, EState *estate, int eflags)
TupleTableSlot * ExecCteScan(CteScanState *node)
Definition: nodeCtescan.c:153
Node * MultiExecProcNode(PlanState *node)
Definition: execProcnode.c:591
TupleTableSlot * ExecSort(SortState *node)
Definition: nodeSort.c:39
SeqScanState * ExecInitSeqScan(SeqScan *node, EState *estate, int eflags)
Definition: nodeSeqscan.c:163
List * initPlan
Definition: plannodes.h:136
Definition: nodes.h:79
LimitState * ExecInitLimit(Limit *node, EState *estate, int eflags)
Definition: nodeLimit.c:364
void ExecEndHash(HashState *node)
Definition: nodeHash.c:218
void ExecShutdownForeignScan(ForeignScanState *node)
void ExecEndProjectSet(ProjectSetState *node)
void ExecEndMaterial(MaterialState *node)
Definition: nodeMaterial.c:240
WorkTableScanState * ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags)
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:97
Definition: plannodes.h:751
#define elog
Definition: elog.h:219
void ExecEndBitmapHeapScan(BitmapHeapScanState *node)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:139
Definition: pg_list.h:45
bool planstate_tree_walker(PlanState *planstate, bool(*walker)(), void *context)
Definition: nodeFuncs.c:3705
void ExecEndAgg(AggState *node)
Definition: nodeAgg.c:3834
void ExecEndModifyTable(ModifyTableState *node)
TupleTableSlot * ExecHash(HashState *node)
Definition: nodeHash.c:60
MaterialState * ExecInitMaterial(Material *node, EState *estate, int eflags)
Definition: nodeMaterial.c:163
TupleTableSlot * ExecAppend(AppendState *node)
Definition: nodeAppend.c:200
void ExecEndGather(GatherState *node)
Definition: nodeGather.c:226
Definition: nodes.h:84