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"
105 #include "executor/nodeNestloop.h"
106 #include "executor/nodeProjectSet.h"
108 #include "executor/nodeResult.h"
109 #include "executor/nodeSamplescan.h"
110 #include "executor/nodeSeqscan.h"
111 #include "executor/nodeSetOp.h"
112 #include "executor/nodeSort.h"
113 #include "executor/nodeSubplan.h"
116 #include "executor/nodeTidscan.h"
117 #include "executor/nodeUnique.h"
118 #include "executor/nodeValuesscan.h"
119 #include "executor/nodeWindowAgg.h"
121 #include "nodes/nodeFuncs.h"
122 #include "miscadmin.h"
123 
124 
125 /* ------------------------------------------------------------------------
126  * ExecInitNode
127  *
128  * Recursively initializes all the nodes in the plan tree rooted
129  * at 'node'.
130  *
131  * Inputs:
132  * 'node' is the current node of the plan produced by the query planner
133  * 'estate' is the shared execution state for the plan tree
134  * 'eflags' is a bitwise OR of flag bits described in executor.h
135  *
136  * Returns a PlanState node corresponding to the given Plan node.
137  * ------------------------------------------------------------------------
138  */
139 PlanState *
140 ExecInitNode(Plan *node, EState *estate, int eflags)
141 {
142  PlanState *result;
143  List *subps;
144  ListCell *l;
145 
146  /*
147  * do nothing when we get to the end of a leaf on tree.
148  */
149  if (node == NULL)
150  return NULL;
151 
152  switch (nodeTag(node))
153  {
154  /*
155  * control nodes
156  */
157  case T_Result:
158  result = (PlanState *) ExecInitResult((Result *) node,
159  estate, eflags);
160  break;
161 
162  case T_ProjectSet:
163  result = (PlanState *) ExecInitProjectSet((ProjectSet *) node,
164  estate, eflags);
165  break;
166 
167  case T_ModifyTable:
168  result = (PlanState *) ExecInitModifyTable((ModifyTable *) node,
169  estate, eflags);
170  break;
171 
172  case T_Append:
173  result = (PlanState *) ExecInitAppend((Append *) node,
174  estate, eflags);
175  break;
176 
177  case T_MergeAppend:
178  result = (PlanState *) ExecInitMergeAppend((MergeAppend *) node,
179  estate, eflags);
180  break;
181 
182  case T_RecursiveUnion:
183  result = (PlanState *) ExecInitRecursiveUnion((RecursiveUnion *) node,
184  estate, eflags);
185  break;
186 
187  case T_BitmapAnd:
188  result = (PlanState *) ExecInitBitmapAnd((BitmapAnd *) node,
189  estate, eflags);
190  break;
191 
192  case T_BitmapOr:
193  result = (PlanState *) ExecInitBitmapOr((BitmapOr *) node,
194  estate, eflags);
195  break;
196 
197  /*
198  * scan nodes
199  */
200  case T_SeqScan:
201  result = (PlanState *) ExecInitSeqScan((SeqScan *) node,
202  estate, eflags);
203  break;
204 
205  case T_SampleScan:
206  result = (PlanState *) ExecInitSampleScan((SampleScan *) node,
207  estate, eflags);
208  break;
209 
210  case T_IndexScan:
211  result = (PlanState *) ExecInitIndexScan((IndexScan *) node,
212  estate, eflags);
213  break;
214 
215  case T_IndexOnlyScan:
216  result = (PlanState *) ExecInitIndexOnlyScan((IndexOnlyScan *) node,
217  estate, eflags);
218  break;
219 
220  case T_BitmapIndexScan:
221  result = (PlanState *) ExecInitBitmapIndexScan((BitmapIndexScan *) node,
222  estate, eflags);
223  break;
224 
225  case T_BitmapHeapScan:
226  result = (PlanState *) ExecInitBitmapHeapScan((BitmapHeapScan *) node,
227  estate, eflags);
228  break;
229 
230  case T_TidScan:
231  result = (PlanState *) ExecInitTidScan((TidScan *) node,
232  estate, eflags);
233  break;
234 
235  case T_SubqueryScan:
236  result = (PlanState *) ExecInitSubqueryScan((SubqueryScan *) node,
237  estate, eflags);
238  break;
239 
240  case T_FunctionScan:
241  result = (PlanState *) ExecInitFunctionScan((FunctionScan *) node,
242  estate, eflags);
243  break;
244 
245  case T_TableFuncScan:
246  result = (PlanState *) ExecInitTableFuncScan((TableFuncScan *) node,
247  estate, eflags);
248  break;
249 
250  case T_ValuesScan:
251  result = (PlanState *) ExecInitValuesScan((ValuesScan *) node,
252  estate, eflags);
253  break;
254 
255  case T_CteScan:
256  result = (PlanState *) ExecInitCteScan((CteScan *) node,
257  estate, eflags);
258  break;
259 
262  estate, eflags);
263  break;
264 
265  case T_WorkTableScan:
266  result = (PlanState *) ExecInitWorkTableScan((WorkTableScan *) node,
267  estate, eflags);
268  break;
269 
270  case T_ForeignScan:
271  result = (PlanState *) ExecInitForeignScan((ForeignScan *) node,
272  estate, eflags);
273  break;
274 
275  case T_CustomScan:
276  result = (PlanState *) ExecInitCustomScan((CustomScan *) node,
277  estate, eflags);
278  break;
279 
280  /*
281  * join nodes
282  */
283  case T_NestLoop:
284  result = (PlanState *) ExecInitNestLoop((NestLoop *) node,
285  estate, eflags);
286  break;
287 
288  case T_MergeJoin:
289  result = (PlanState *) ExecInitMergeJoin((MergeJoin *) node,
290  estate, eflags);
291  break;
292 
293  case T_HashJoin:
294  result = (PlanState *) ExecInitHashJoin((HashJoin *) node,
295  estate, eflags);
296  break;
297 
298  /*
299  * materialization nodes
300  */
301  case T_Material:
302  result = (PlanState *) ExecInitMaterial((Material *) node,
303  estate, eflags);
304  break;
305 
306  case T_Sort:
307  result = (PlanState *) ExecInitSort((Sort *) node,
308  estate, eflags);
309  break;
310 
311  case T_Group:
312  result = (PlanState *) ExecInitGroup((Group *) node,
313  estate, eflags);
314  break;
315 
316  case T_Agg:
317  result = (PlanState *) ExecInitAgg((Agg *) node,
318  estate, eflags);
319  break;
320 
321  case T_WindowAgg:
322  result = (PlanState *) ExecInitWindowAgg((WindowAgg *) node,
323  estate, eflags);
324  break;
325 
326  case T_Unique:
327  result = (PlanState *) ExecInitUnique((Unique *) node,
328  estate, eflags);
329  break;
330 
331  case T_Gather:
332  result = (PlanState *) ExecInitGather((Gather *) node,
333  estate, eflags);
334  break;
335 
336  case T_GatherMerge:
337  result = (PlanState *) ExecInitGatherMerge((GatherMerge *) node,
338  estate, eflags);
339  break;
340 
341  case T_Hash:
342  result = (PlanState *) ExecInitHash((Hash *) node,
343  estate, eflags);
344  break;
345 
346  case T_SetOp:
347  result = (PlanState *) ExecInitSetOp((SetOp *) node,
348  estate, eflags);
349  break;
350 
351  case T_LockRows:
352  result = (PlanState *) ExecInitLockRows((LockRows *) node,
353  estate, eflags);
354  break;
355 
356  case T_Limit:
357  result = (PlanState *) ExecInitLimit((Limit *) node,
358  estate, eflags);
359  break;
360 
361  default:
362  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
363  result = NULL; /* keep compiler quiet */
364  break;
365  }
366 
367  /*
368  * Initialize any initPlans present in this node. The planner put them in
369  * a separate list for us.
370  */
371  subps = NIL;
372  foreach(l, node->initPlan)
373  {
374  SubPlan *subplan = (SubPlan *) lfirst(l);
375  SubPlanState *sstate;
376 
377  Assert(IsA(subplan, SubPlan));
378  sstate = ExecInitSubPlan(subplan, result);
379  subps = lappend(subps, sstate);
380  }
381  result->initPlan = subps;
382 
383  /* Set up instrumentation for this node if requested */
384  if (estate->es_instrument)
385  result->instrument = InstrAlloc(1, estate->es_instrument);
386 
387  return result;
388 }
389 
390 
391 /* ----------------------------------------------------------------
392  * ExecProcNode
393  *
394  * Execute the given node to return a(nother) tuple.
395  * ----------------------------------------------------------------
396  */
399 {
401 
403 
404  if (node->chgParam != NULL) /* something changed */
405  ExecReScan(node); /* let ReScan handle this */
406 
407  if (node->instrument)
408  InstrStartNode(node->instrument);
409 
410  switch (nodeTag(node))
411  {
412  /*
413  * control nodes
414  */
415  case T_ResultState:
416  result = ExecResult((ResultState *) node);
417  break;
418 
419  case T_ProjectSetState:
420  result = ExecProjectSet((ProjectSetState *) node);
421  break;
422 
423  case T_ModifyTableState:
424  result = ExecModifyTable((ModifyTableState *) node);
425  break;
426 
427  case T_AppendState:
428  result = ExecAppend((AppendState *) node);
429  break;
430 
431  case T_MergeAppendState:
432  result = ExecMergeAppend((MergeAppendState *) node);
433  break;
434 
436  result = ExecRecursiveUnion((RecursiveUnionState *) node);
437  break;
438 
439  /* BitmapAndState does not yield tuples */
440 
441  /* BitmapOrState does not yield tuples */
442 
443  /*
444  * scan nodes
445  */
446  case T_SeqScanState:
447  result = ExecSeqScan((SeqScanState *) node);
448  break;
449 
450  case T_SampleScanState:
451  result = ExecSampleScan((SampleScanState *) node);
452  break;
453 
454  case T_IndexScanState:
455  result = ExecIndexScan((IndexScanState *) node);
456  break;
457 
459  result = ExecIndexOnlyScan((IndexOnlyScanState *) node);
460  break;
461 
462  /* BitmapIndexScanState does not yield tuples */
463 
465  result = ExecBitmapHeapScan((BitmapHeapScanState *) node);
466  break;
467 
468  case T_TidScanState:
469  result = ExecTidScan((TidScanState *) node);
470  break;
471 
472  case T_SubqueryScanState:
473  result = ExecSubqueryScan((SubqueryScanState *) node);
474  break;
475 
476  case T_FunctionScanState:
477  result = ExecFunctionScan((FunctionScanState *) node);
478  break;
479 
481  result = ExecTableFuncScan((TableFuncScanState *) node);
482  break;
483 
484  case T_ValuesScanState:
485  result = ExecValuesScan((ValuesScanState *) node);
486  break;
487 
488  case T_CteScanState:
489  result = ExecCteScan((CteScanState *) node);
490  break;
491 
494  break;
495 
497  result = ExecWorkTableScan((WorkTableScanState *) node);
498  break;
499 
500  case T_ForeignScanState:
501  result = ExecForeignScan((ForeignScanState *) node);
502  break;
503 
504  case T_CustomScanState:
505  result = ExecCustomScan((CustomScanState *) node);
506  break;
507 
508  /*
509  * join nodes
510  */
511  case T_NestLoopState:
512  result = ExecNestLoop((NestLoopState *) node);
513  break;
514 
515  case T_MergeJoinState:
516  result = ExecMergeJoin((MergeJoinState *) node);
517  break;
518 
519  case T_HashJoinState:
520  result = ExecHashJoin((HashJoinState *) node);
521  break;
522 
523  /*
524  * materialization nodes
525  */
526  case T_MaterialState:
527  result = ExecMaterial((MaterialState *) node);
528  break;
529 
530  case T_SortState:
531  result = ExecSort((SortState *) node);
532  break;
533 
534  case T_GroupState:
535  result = ExecGroup((GroupState *) node);
536  break;
537 
538  case T_AggState:
539  result = ExecAgg((AggState *) node);
540  break;
541 
542  case T_WindowAggState:
543  result = ExecWindowAgg((WindowAggState *) node);
544  break;
545 
546  case T_UniqueState:
547  result = ExecUnique((UniqueState *) node);
548  break;
549 
550  case T_GatherState:
551  result = ExecGather((GatherState *) node);
552  break;
553 
554  case T_GatherMergeState:
555  result = ExecGatherMerge((GatherMergeState *) node);
556  break;
557 
558  case T_HashState:
559  result = ExecHash((HashState *) node);
560  break;
561 
562  case T_SetOpState:
563  result = ExecSetOp((SetOpState *) node);
564  break;
565 
566  case T_LockRowsState:
567  result = ExecLockRows((LockRowsState *) node);
568  break;
569 
570  case T_LimitState:
571  result = ExecLimit((LimitState *) node);
572  break;
573 
574  default:
575  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
576  result = NULL;
577  break;
578  }
579 
580  if (node->instrument)
581  InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
582 
583  return result;
584 }
585 
586 
587 /* ----------------------------------------------------------------
588  * MultiExecProcNode
589  *
590  * Execute a node that doesn't return individual tuples
591  * (it might return a hashtable, bitmap, etc). Caller should
592  * check it got back the expected kind of Node.
593  *
594  * This has essentially the same responsibilities as ExecProcNode,
595  * but it does not do InstrStartNode/InstrStopNode (mainly because
596  * it can't tell how many returned tuples to count). Each per-node
597  * function must provide its own instrumentation support.
598  * ----------------------------------------------------------------
599  */
600 Node *
602 {
603  Node *result;
604 
606 
607  if (node->chgParam != NULL) /* something changed */
608  ExecReScan(node); /* let ReScan handle this */
609 
610  switch (nodeTag(node))
611  {
612  /*
613  * Only node types that actually support multiexec will be listed
614  */
615 
616  case T_HashState:
617  result = MultiExecHash((HashState *) node);
618  break;
619 
622  break;
623 
624  case T_BitmapAndState:
625  result = MultiExecBitmapAnd((BitmapAndState *) node);
626  break;
627 
628  case T_BitmapOrState:
629  result = MultiExecBitmapOr((BitmapOrState *) node);
630  break;
631 
632  default:
633  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
634  result = NULL;
635  break;
636  }
637 
638  return result;
639 }
640 
641 
642 /* ----------------------------------------------------------------
643  * ExecEndNode
644  *
645  * Recursively cleans up all the nodes in the plan rooted
646  * at 'node'.
647  *
648  * After this operation, the query plan will not be able to be
649  * processed any further. This should be called only after
650  * the query plan has been fully executed.
651  * ----------------------------------------------------------------
652  */
653 void
655 {
656  /*
657  * do nothing when we get to the end of a leaf on tree.
658  */
659  if (node == NULL)
660  return;
661 
662  if (node->chgParam != NULL)
663  {
664  bms_free(node->chgParam);
665  node->chgParam = NULL;
666  }
667 
668  switch (nodeTag(node))
669  {
670  /*
671  * control nodes
672  */
673  case T_ResultState:
674  ExecEndResult((ResultState *) node);
675  break;
676 
677  case T_ProjectSetState:
679  break;
680 
681  case T_ModifyTableState:
683  break;
684 
685  case T_AppendState:
686  ExecEndAppend((AppendState *) node);
687  break;
688 
689  case T_MergeAppendState:
691  break;
692 
695  break;
696 
697  case T_BitmapAndState:
699  break;
700 
701  case T_BitmapOrState:
702  ExecEndBitmapOr((BitmapOrState *) node);
703  break;
704 
705  /*
706  * scan nodes
707  */
708  case T_SeqScanState:
709  ExecEndSeqScan((SeqScanState *) node);
710  break;
711 
712  case T_SampleScanState:
714  break;
715 
716  case T_GatherState:
717  ExecEndGather((GatherState *) node);
718  break;
719 
720  case T_GatherMergeState:
722  break;
723 
724  case T_IndexScanState:
726  break;
727 
730  break;
731 
734  break;
735 
738  break;
739 
740  case T_TidScanState:
741  ExecEndTidScan((TidScanState *) node);
742  break;
743 
744  case T_SubqueryScanState:
746  break;
747 
748  case T_FunctionScanState:
750  break;
751 
754  break;
755 
756  case T_ValuesScanState:
758  break;
759 
760  case T_CteScanState:
761  ExecEndCteScan((CteScanState *) node);
762  break;
763 
766  break;
767 
770  break;
771 
772  case T_ForeignScanState:
774  break;
775 
776  case T_CustomScanState:
778  break;
779 
780  /*
781  * join nodes
782  */
783  case T_NestLoopState:
784  ExecEndNestLoop((NestLoopState *) node);
785  break;
786 
787  case T_MergeJoinState:
789  break;
790 
791  case T_HashJoinState:
792  ExecEndHashJoin((HashJoinState *) node);
793  break;
794 
795  /*
796  * materialization nodes
797  */
798  case T_MaterialState:
799  ExecEndMaterial((MaterialState *) node);
800  break;
801 
802  case T_SortState:
803  ExecEndSort((SortState *) node);
804  break;
805 
806  case T_GroupState:
807  ExecEndGroup((GroupState *) node);
808  break;
809 
810  case T_AggState:
811  ExecEndAgg((AggState *) node);
812  break;
813 
814  case T_WindowAggState:
816  break;
817 
818  case T_UniqueState:
819  ExecEndUnique((UniqueState *) node);
820  break;
821 
822  case T_HashState:
823  ExecEndHash((HashState *) node);
824  break;
825 
826  case T_SetOpState:
827  ExecEndSetOp((SetOpState *) node);
828  break;
829 
830  case T_LockRowsState:
831  ExecEndLockRows((LockRowsState *) node);
832  break;
833 
834  case T_LimitState:
835  ExecEndLimit((LimitState *) node);
836  break;
837 
838  default:
839  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
840  break;
841  }
842 }
843 
844 /*
845  * ExecShutdownNode
846  *
847  * Give execution nodes a chance to stop asynchronous resource consumption
848  * and release any resources still held. Currently, this is only used for
849  * parallel query, but we might want to extend it to other cases also (e.g.
850  * FDW). We might also want to call it sooner, as soon as it's evident that
851  * no more rows will be needed (e.g. when a Limit is filled) rather than only
852  * at the end of ExecutorRun.
853  */
854 bool
856 {
857  if (node == NULL)
858  return false;
859 
861 
862  switch (nodeTag(node))
863  {
864  case T_GatherState:
866  break;
867  case T_ForeignScanState:
869  break;
870  case T_CustomScanState:
872  break;
873  case T_GatherMergeState:
875  break;
876  default:
877  break;
878  }
879 
880  return false;
881 }
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
NamedTuplestoreScanState * ExecInitNamedTuplestoreScan(NamedTuplestoreScan *node, EState *estate, int eflags)
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:77
SortState * ExecInitSort(Sort *node, EState *estate, int eflags)
Definition: nodeSort.c:153
TupleTableSlot * ExecProcNode(PlanState *node)
Definition: execProcnode.c:398
#define IsA(nodeptr, _type_)
Definition: nodes.h:560
void ExecEndNestLoop(NestLoopState *node)
Definition: nodeNestloop.c:361
TupleTableSlot * ExecSampleScan(SampleScanState *node)
BitmapHeapScanState * ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
TupleTableSlot * ExecValuesScan(ValuesScanState *node)
TupleTableSlot * ExecNamedTuplestoreScan(NamedTuplestoreScanState *node)
Definition: nodes.h:79
Instrumentation * instrument
Definition: execnodes.h:838
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:2099
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:855
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:654
void ExecShutdownCustomScan(CustomScanState *node)
Definition: nodeCustom.c:203
GatherMergeState * ExecInitGatherMerge(GatherMerge *node, EState *estate, int eflags)
List * initPlan
Definition: execnodes.h:849
RecursiveUnionState * ExecInitRecursiveUnion(RecursiveUnion *node, EState *estate, int eflags)
NestLoopState * ExecInitNestLoop(NestLoop *node, EState *estate, int eflags)
Definition: nodeNestloop.c:259
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:75
void ExecEndLockRows(LockRowsState *node)
Definition: nodeLockRows.c:446
void ExecEndNamedTuplestoreScan(NamedTuplestoreScanState *node)
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:509
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:1633
Definition: nodes.h:75
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:548
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:2657
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:224
BitmapIndexScanState * ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
Definition: nodes.h:76
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:478
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:856
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:382
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:82
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:514
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:83
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:601
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:148
Definition: nodes.h:80
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:98
Definition: plannodes.h:780
#define elog
Definition: elog.h:219
void ExecEndBitmapHeapScan(BitmapHeapScanState *node)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
Definition: execProcnode.c:140
Definition: pg_list.h:45
bool planstate_tree_walker(PlanState *planstate, bool(*walker)(), void *context)
Definition: nodeFuncs.c:3697
void ExecEndAgg(AggState *node)
Definition: nodeAgg.c:3836
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:85