PostgreSQL Source Code  git master
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-2018, 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  * NOTES
21  * This used to be three files. It is now all combined into
22  * one file so that it is easier to keep the dispatch routines
23  * in sync when new nodes are added.
24  *
25  * EXAMPLE
26  * Suppose we want the age of the manager of the shoe department and
27  * the number of employees in that department. So we have the query:
28  *
29  * select DEPT.no_emps, EMP.age
30  * from DEPT, EMP
31  * where EMP.name = DEPT.mgr and
32  * DEPT.name = "shoe"
33  *
34  * Suppose the planner gives us the following plan:
35  *
36  * Nest Loop (DEPT.mgr = EMP.name)
37  * / \
38  * / \
39  * Seq Scan Seq Scan
40  * DEPT EMP
41  * (name = "shoe")
42  *
43  * ExecutorStart() is called first.
44  * It calls InitPlan() which calls ExecInitNode() on
45  * the root of the plan -- the nest loop node.
46  *
47  * * ExecInitNode() notices that it is looking at a nest loop and
48  * as the code below demonstrates, it calls ExecInitNestLoop().
49  * Eventually this calls ExecInitNode() on the right and left subplans
50  * and so forth until the entire plan is initialized. The result
51  * of ExecInitNode() is a plan state tree built with the same structure
52  * as the underlying plan tree.
53  *
54  * * Then when ExecutorRun() is called, it calls ExecutePlan() which calls
55  * ExecProcNode() repeatedly on the top node of the plan state tree.
56  * Each time this happens, ExecProcNode() will end up calling
57  * ExecNestLoop(), which calls ExecProcNode() on its subplans.
58  * Each of these subplans is a sequential scan so ExecSeqScan() is
59  * called. The slots returned by ExecSeqScan() may contain
60  * tuples which contain the attributes ExecNestLoop() uses to
61  * form the tuples it returns.
62  *
63  * * Eventually ExecSeqScan() stops returning tuples and the nest
64  * loop join ends. Lastly, ExecutorEnd() calls ExecEndNode() which
65  * calls ExecEndNestLoop() which in turn calls ExecEndNode() on
66  * its subplans which result in ExecEndSeqScan().
67  *
68  * This should show how the executor works by having
69  * ExecInitNode(), ExecProcNode() and ExecEndNode() dispatch
70  * their work to the appropriate node support routines which may
71  * in turn call these routines themselves on their subplans.
72  */
73 #include "postgres.h"
74 
75 #include "executor/executor.h"
76 #include "executor/nodeAgg.h"
77 #include "executor/nodeAppend.h"
78 #include "executor/nodeBitmapAnd.h"
81 #include "executor/nodeBitmapOr.h"
82 #include "executor/nodeCtescan.h"
83 #include "executor/nodeCustom.h"
86 #include "executor/nodeGather.h"
88 #include "executor/nodeGroup.h"
89 #include "executor/nodeHash.h"
90 #include "executor/nodeHashjoin.h"
92 #include "executor/nodeIndexscan.h"
93 #include "executor/nodeLimit.h"
94 #include "executor/nodeLockRows.h"
95 #include "executor/nodeMaterial.h"
97 #include "executor/nodeMergejoin.h"
100 #include "executor/nodeNestloop.h"
101 #include "executor/nodeProjectSet.h"
103 #include "executor/nodeResult.h"
104 #include "executor/nodeSamplescan.h"
105 #include "executor/nodeSeqscan.h"
106 #include "executor/nodeSetOp.h"
107 #include "executor/nodeSort.h"
108 #include "executor/nodeSubplan.h"
111 #include "executor/nodeTidscan.h"
112 #include "executor/nodeUnique.h"
113 #include "executor/nodeValuesscan.h"
114 #include "executor/nodeWindowAgg.h"
116 #include "nodes/nodeFuncs.h"
117 #include "miscadmin.h"
118 
119 
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  /*
152  * Make sure there's enough stack available. Need to check here, in
153  * addition to ExecProcNode() (via ExecProcNodeFirst()), to ensure the
154  * stack isn't overrun while initializing the node tree.
155  */
157 
158  switch (nodeTag(node))
159  {
160  /*
161  * control nodes
162  */
163  case T_Result:
164  result = (PlanState *) ExecInitResult((Result *) node,
165  estate, eflags);
166  break;
167 
168  case T_ProjectSet:
169  result = (PlanState *) ExecInitProjectSet((ProjectSet *) node,
170  estate, eflags);
171  break;
172 
173  case T_ModifyTable:
174  result = (PlanState *) ExecInitModifyTable((ModifyTable *) node,
175  estate, eflags);
176  break;
177 
178  case T_Append:
179  result = (PlanState *) ExecInitAppend((Append *) node,
180  estate, eflags);
181  break;
182 
183  case T_MergeAppend:
184  result = (PlanState *) ExecInitMergeAppend((MergeAppend *) node,
185  estate, eflags);
186  break;
187 
188  case T_RecursiveUnion:
189  result = (PlanState *) ExecInitRecursiveUnion((RecursiveUnion *) node,
190  estate, eflags);
191  break;
192 
193  case T_BitmapAnd:
194  result = (PlanState *) ExecInitBitmapAnd((BitmapAnd *) node,
195  estate, eflags);
196  break;
197 
198  case T_BitmapOr:
199  result = (PlanState *) ExecInitBitmapOr((BitmapOr *) node,
200  estate, eflags);
201  break;
202 
203  /*
204  * scan nodes
205  */
206  case T_SeqScan:
207  result = (PlanState *) ExecInitSeqScan((SeqScan *) node,
208  estate, eflags);
209  break;
210 
211  case T_SampleScan:
212  result = (PlanState *) ExecInitSampleScan((SampleScan *) node,
213  estate, eflags);
214  break;
215 
216  case T_IndexScan:
217  result = (PlanState *) ExecInitIndexScan((IndexScan *) node,
218  estate, eflags);
219  break;
220 
221  case T_IndexOnlyScan:
222  result = (PlanState *) ExecInitIndexOnlyScan((IndexOnlyScan *) node,
223  estate, eflags);
224  break;
225 
226  case T_BitmapIndexScan:
227  result = (PlanState *) ExecInitBitmapIndexScan((BitmapIndexScan *) node,
228  estate, eflags);
229  break;
230 
231  case T_BitmapHeapScan:
232  result = (PlanState *) ExecInitBitmapHeapScan((BitmapHeapScan *) node,
233  estate, eflags);
234  break;
235 
236  case T_TidScan:
237  result = (PlanState *) ExecInitTidScan((TidScan *) node,
238  estate, eflags);
239  break;
240 
241  case T_SubqueryScan:
242  result = (PlanState *) ExecInitSubqueryScan((SubqueryScan *) node,
243  estate, eflags);
244  break;
245 
246  case T_FunctionScan:
247  result = (PlanState *) ExecInitFunctionScan((FunctionScan *) node,
248  estate, eflags);
249  break;
250 
251  case T_TableFuncScan:
252  result = (PlanState *) ExecInitTableFuncScan((TableFuncScan *) node,
253  estate, eflags);
254  break;
255 
256  case T_ValuesScan:
257  result = (PlanState *) ExecInitValuesScan((ValuesScan *) node,
258  estate, eflags);
259  break;
260 
261  case T_CteScan:
262  result = (PlanState *) ExecInitCteScan((CteScan *) node,
263  estate, eflags);
264  break;
265 
268  estate, eflags);
269  break;
270 
271  case T_WorkTableScan:
272  result = (PlanState *) ExecInitWorkTableScan((WorkTableScan *) node,
273  estate, eflags);
274  break;
275 
276  case T_ForeignScan:
277  result = (PlanState *) ExecInitForeignScan((ForeignScan *) node,
278  estate, eflags);
279  break;
280 
281  case T_CustomScan:
282  result = (PlanState *) ExecInitCustomScan((CustomScan *) node,
283  estate, eflags);
284  break;
285 
286  /*
287  * join nodes
288  */
289  case T_NestLoop:
290  result = (PlanState *) ExecInitNestLoop((NestLoop *) node,
291  estate, eflags);
292  break;
293 
294  case T_MergeJoin:
295  result = (PlanState *) ExecInitMergeJoin((MergeJoin *) node,
296  estate, eflags);
297  break;
298 
299  case T_HashJoin:
300  result = (PlanState *) ExecInitHashJoin((HashJoin *) node,
301  estate, eflags);
302  break;
303 
304  /*
305  * materialization nodes
306  */
307  case T_Material:
308  result = (PlanState *) ExecInitMaterial((Material *) node,
309  estate, eflags);
310  break;
311 
312  case T_Sort:
313  result = (PlanState *) ExecInitSort((Sort *) node,
314  estate, eflags);
315  break;
316 
317  case T_Group:
318  result = (PlanState *) ExecInitGroup((Group *) node,
319  estate, eflags);
320  break;
321 
322  case T_Agg:
323  result = (PlanState *) ExecInitAgg((Agg *) node,
324  estate, eflags);
325  break;
326 
327  case T_WindowAgg:
328  result = (PlanState *) ExecInitWindowAgg((WindowAgg *) node,
329  estate, eflags);
330  break;
331 
332  case T_Unique:
333  result = (PlanState *) ExecInitUnique((Unique *) node,
334  estate, eflags);
335  break;
336 
337  case T_Gather:
338  result = (PlanState *) ExecInitGather((Gather *) node,
339  estate, eflags);
340  break;
341 
342  case T_GatherMerge:
343  result = (PlanState *) ExecInitGatherMerge((GatherMerge *) node,
344  estate, eflags);
345  break;
346 
347  case T_Hash:
348  result = (PlanState *) ExecInitHash((Hash *) node,
349  estate, eflags);
350  break;
351 
352  case T_SetOp:
353  result = (PlanState *) ExecInitSetOp((SetOp *) node,
354  estate, eflags);
355  break;
356 
357  case T_LockRows:
358  result = (PlanState *) ExecInitLockRows((LockRows *) node,
359  estate, eflags);
360  break;
361 
362  case T_Limit:
363  result = (PlanState *) ExecInitLimit((Limit *) node,
364  estate, eflags);
365  break;
366 
367  default:
368  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
369  result = NULL; /* keep compiler quiet */
370  break;
371  }
372 
373  ExecSetExecProcNode(result, result->ExecProcNode);
374 
375  /*
376  * Initialize any initPlans present in this node. The planner put them in
377  * a separate list for us.
378  */
379  subps = NIL;
380  foreach(l, node->initPlan)
381  {
382  SubPlan *subplan = (SubPlan *) lfirst(l);
383  SubPlanState *sstate;
384 
385  Assert(IsA(subplan, SubPlan));
386  sstate = ExecInitSubPlan(subplan, result);
387  subps = lappend(subps, sstate);
388  }
389  result->initPlan = subps;
390 
391  /* Set up instrumentation for this node if requested */
392  if (estate->es_instrument)
393  result->instrument = InstrAlloc(1, estate->es_instrument);
394 
395  return result;
396 }
397 
398 
399 /*
400  * If a node wants to change its ExecProcNode function after ExecInitNode()
401  * has finished, it should do so with this function. That way any wrapper
402  * functions can be reinstalled, without the node having to know how that
403  * works.
404  */
405 void
407 {
408  /*
409  * Add a wrapper around the ExecProcNode callback that checks stack depth
410  * during the first execution and maybe adds an instrumentation
411  * wrapper. When the callback is changed after execution has already begun
412  * that means we'll superflously execute ExecProcNodeFirst, but that seems
413  * ok.
414  */
415  node->ExecProcNodeReal = function;
417 }
418 
419 
420 /*
421  * ExecProcNode wrapper that performs some one-time checks, before calling
422  * the relevant node method (possibly via an instrumentation wrapper).
423  */
424 static TupleTableSlot *
426 {
427  /*
428  * Perform stack depth check during the first execution of the node. We
429  * only do so the first time round because it turns out to not be cheap on
430  * some common architectures (eg. x86). This relies on the assumption
431  * that ExecProcNode calls for a given plan node will always be made at
432  * roughly the same stack depth.
433  */
435 
436  /*
437  * If instrumentation is required, change the wrapper to one that just
438  * does instrumentation. Otherwise we can dispense with all wrappers and
439  * have ExecProcNode() directly call the relevant function from now on.
440  */
441  if (node->instrument)
443  else
444  node->ExecProcNode = node->ExecProcNodeReal;
445 
446  return node->ExecProcNode(node);
447 }
448 
449 
450 /*
451  * ExecProcNode wrapper that performs instrumentation calls. By keeping
452  * this a separate function, we avoid overhead in the normal case where
453  * no instrumentation is wanted.
454  */
455 static TupleTableSlot *
457 {
458  TupleTableSlot *result;
459 
460  InstrStartNode(node->instrument);
461 
462  result = node->ExecProcNodeReal(node);
463 
464  InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
465 
466  return result;
467 }
468 
469 
470 /* ----------------------------------------------------------------
471  * MultiExecProcNode
472  *
473  * Execute a node that doesn't return individual tuples
474  * (it might return a hashtable, bitmap, etc). Caller should
475  * check it got back the expected kind of Node.
476  *
477  * This has essentially the same responsibilities as ExecProcNode,
478  * but it does not do InstrStartNode/InstrStopNode (mainly because
479  * it can't tell how many returned tuples to count). Each per-node
480  * function must provide its own instrumentation support.
481  * ----------------------------------------------------------------
482  */
483 Node *
485 {
486  Node *result;
487 
489 
491 
492  if (node->chgParam != NULL) /* something changed */
493  ExecReScan(node); /* let ReScan handle this */
494 
495  switch (nodeTag(node))
496  {
497  /*
498  * Only node types that actually support multiexec will be listed
499  */
500 
501  case T_HashState:
502  result = MultiExecHash((HashState *) node);
503  break;
504 
507  break;
508 
509  case T_BitmapAndState:
510  result = MultiExecBitmapAnd((BitmapAndState *) node);
511  break;
512 
513  case T_BitmapOrState:
514  result = MultiExecBitmapOr((BitmapOrState *) node);
515  break;
516 
517  default:
518  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
519  result = NULL;
520  break;
521  }
522 
523  return result;
524 }
525 
526 
527 /* ----------------------------------------------------------------
528  * ExecEndNode
529  *
530  * Recursively cleans up all the nodes in the plan rooted
531  * at 'node'.
532  *
533  * After this operation, the query plan will not be able to be
534  * processed any further. This should be called only after
535  * the query plan has been fully executed.
536  * ----------------------------------------------------------------
537  */
538 void
540 {
541  /*
542  * do nothing when we get to the end of a leaf on tree.
543  */
544  if (node == NULL)
545  return;
546 
547  /*
548  * Make sure there's enough stack available. Need to check here, in
549  * addition to ExecProcNode() (via ExecProcNodeFirst()), because it's not
550  * guaranteed that ExecProcNode() is reached for all nodes.
551  */
553 
554  if (node->chgParam != NULL)
555  {
556  bms_free(node->chgParam);
557  node->chgParam = NULL;
558  }
559 
560  switch (nodeTag(node))
561  {
562  /*
563  * control nodes
564  */
565  case T_ResultState:
566  ExecEndResult((ResultState *) node);
567  break;
568 
569  case T_ProjectSetState:
571  break;
572 
573  case T_ModifyTableState:
575  break;
576 
577  case T_AppendState:
578  ExecEndAppend((AppendState *) node);
579  break;
580 
581  case T_MergeAppendState:
583  break;
584 
587  break;
588 
589  case T_BitmapAndState:
591  break;
592 
593  case T_BitmapOrState:
594  ExecEndBitmapOr((BitmapOrState *) node);
595  break;
596 
597  /*
598  * scan nodes
599  */
600  case T_SeqScanState:
601  ExecEndSeqScan((SeqScanState *) node);
602  break;
603 
604  case T_SampleScanState:
606  break;
607 
608  case T_GatherState:
609  ExecEndGather((GatherState *) node);
610  break;
611 
612  case T_GatherMergeState:
614  break;
615 
616  case T_IndexScanState:
618  break;
619 
622  break;
623 
626  break;
627 
630  break;
631 
632  case T_TidScanState:
633  ExecEndTidScan((TidScanState *) node);
634  break;
635 
636  case T_SubqueryScanState:
638  break;
639 
640  case T_FunctionScanState:
642  break;
643 
646  break;
647 
648  case T_ValuesScanState:
650  break;
651 
652  case T_CteScanState:
653  ExecEndCteScan((CteScanState *) node);
654  break;
655 
658  break;
659 
662  break;
663 
664  case T_ForeignScanState:
666  break;
667 
668  case T_CustomScanState:
670  break;
671 
672  /*
673  * join nodes
674  */
675  case T_NestLoopState:
676  ExecEndNestLoop((NestLoopState *) node);
677  break;
678 
679  case T_MergeJoinState:
681  break;
682 
683  case T_HashJoinState:
684  ExecEndHashJoin((HashJoinState *) node);
685  break;
686 
687  /*
688  * materialization nodes
689  */
690  case T_MaterialState:
691  ExecEndMaterial((MaterialState *) node);
692  break;
693 
694  case T_SortState:
695  ExecEndSort((SortState *) node);
696  break;
697 
698  case T_GroupState:
699  ExecEndGroup((GroupState *) node);
700  break;
701 
702  case T_AggState:
703  ExecEndAgg((AggState *) node);
704  break;
705 
706  case T_WindowAggState:
708  break;
709 
710  case T_UniqueState:
711  ExecEndUnique((UniqueState *) node);
712  break;
713 
714  case T_HashState:
715  ExecEndHash((HashState *) node);
716  break;
717 
718  case T_SetOpState:
719  ExecEndSetOp((SetOpState *) node);
720  break;
721 
722  case T_LockRowsState:
723  ExecEndLockRows((LockRowsState *) node);
724  break;
725 
726  case T_LimitState:
727  ExecEndLimit((LimitState *) node);
728  break;
729 
730  default:
731  elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));
732  break;
733  }
734 }
735 
736 /*
737  * ExecShutdownNode
738  *
739  * Give execution nodes a chance to stop asynchronous resource consumption
740  * and release any resources still held. Currently, this is only used for
741  * parallel query, but we might want to extend it to other cases also (e.g.
742  * FDW). We might also want to call it sooner, as soon as it's evident that
743  * no more rows will be needed (e.g. when a Limit is filled) rather than only
744  * at the end of ExecutorRun.
745  */
746 bool
748 {
749  if (node == NULL)
750  return false;
751 
753 
755 
756  switch (nodeTag(node))
757  {
758  case T_GatherState:
760  break;
761  case T_ForeignScanState:
763  break;
764  case T_CustomScanState:
766  break;
767  case T_GatherMergeState:
769  break;
770  case T_HashState:
771  ExecShutdownHash((HashState *) node);
772  break;
773  case T_HashJoinState:
775  break;
776  default:
777  break;
778  }
779 
780  return false;
781 }
782 
783 /*
784  * ExecSetTupleBound
785  *
786  * Set a tuple bound for a planstate node. This lets child plan nodes
787  * optimize based on the knowledge that the maximum number of tuples that
788  * their parent will demand is limited. The tuple bound for a node may
789  * only be changed between scans (i.e., after node initialization or just
790  * before an ExecReScan call).
791  *
792  * Any negative tuples_needed value means "no limit", which should be the
793  * default assumption when this is not called at all for a particular node.
794  *
795  * Note: if this is called repeatedly on a plan tree, the exact same set
796  * of nodes must be updated with the new limit each time; be careful that
797  * only unchanging conditions are tested here.
798  */
799 void
800 ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
801 {
802  /*
803  * Since this function recurses, in principle we should check stack depth
804  * here. In practice, it's probably pointless since the earlier node
805  * initialization tree traversal would surely have consumed more stack.
806  */
807 
808  if (IsA(child_node, SortState))
809  {
810  /*
811  * If it is a Sort node, notify it that it can use bounded sort.
812  *
813  * Note: it is the responsibility of nodeSort.c to react properly to
814  * changes of these parameters. If we ever redesign this, it'd be a
815  * good idea to integrate this signaling with the parameter-change
816  * mechanism.
817  */
818  SortState *sortState = (SortState *) child_node;
819 
820  if (tuples_needed < 0)
821  {
822  /* make sure flag gets reset if needed upon rescan */
823  sortState->bounded = false;
824  }
825  else
826  {
827  sortState->bounded = true;
828  sortState->bound = tuples_needed;
829  }
830  }
831  else if (IsA(child_node, MergeAppendState))
832  {
833  /*
834  * If it is a MergeAppend, we can apply the bound to any nodes that
835  * are children of the MergeAppend, since the MergeAppend surely need
836  * read no more than that many tuples from any one input.
837  */
838  MergeAppendState *maState = (MergeAppendState *) child_node;
839  int i;
840 
841  for (i = 0; i < maState->ms_nplans; i++)
842  ExecSetTupleBound(tuples_needed, maState->mergeplans[i]);
843  }
844  else if (IsA(child_node, ResultState))
845  {
846  /*
847  * Similarly, for a projecting Result, we can apply the bound to its
848  * child node.
849  *
850  * If Result supported qual checking, we'd have to punt on seeing a
851  * qual. Note that having a resconstantqual is not a showstopper: if
852  * that condition succeeds it affects nothing, while if it fails, no
853  * rows will be demanded from the Result child anyway.
854  */
855  if (outerPlanState(child_node))
856  ExecSetTupleBound(tuples_needed, outerPlanState(child_node));
857  }
858  else if (IsA(child_node, SubqueryScanState))
859  {
860  /*
861  * We can also descend through SubqueryScan, but only if it has no
862  * qual (otherwise it might discard rows).
863  */
864  SubqueryScanState *subqueryState = (SubqueryScanState *) child_node;
865 
866  if (subqueryState->ss.ps.qual == NULL)
867  ExecSetTupleBound(tuples_needed, subqueryState->subplan);
868  }
869  else if (IsA(child_node, GatherState))
870  {
871  /*
872  * A Gather node can propagate the bound to its workers. As with
873  * MergeAppend, no one worker could possibly need to return more
874  * tuples than the Gather itself needs to.
875  *
876  * Note: As with Sort, the Gather node is responsible for reacting
877  * properly to changes to this parameter.
878  */
879  GatherState *gstate = (GatherState *) child_node;
880 
881  gstate->tuples_needed = tuples_needed;
882 
883  /* Also pass down the bound to our own copy of the child plan */
884  ExecSetTupleBound(tuples_needed, outerPlanState(child_node));
885  }
886  else if (IsA(child_node, GatherMergeState))
887  {
888  /* Same comments as for Gather */
889  GatherMergeState *gstate = (GatherMergeState *) child_node;
890 
891  gstate->tuples_needed = tuples_needed;
892 
893  ExecSetTupleBound(tuples_needed, outerPlanState(child_node));
894  }
895 
896  /*
897  * In principle we could descend through any plan node type that is
898  * certain not to discard or combine input rows; but on seeing a node that
899  * can do that, we can't propagate the bound any further. For the moment
900  * it's unclear that any other cases are worth checking here.
901  */
902 }
void ExecEndGroup(GroupState *node)
Definition: nodeGroup.c:231
MergeJoinState * ExecInitMergeJoin(MergeJoin *node, EState *estate, int eflags)
void ExecEndSetOp(SetOpState *node)
Definition: nodeSetOp.c:582
#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)
Definition: nodes.h:77
SortState * ExecInitSort(Sort *node, EState *estate, int eflags)
Definition: nodeSort.c:166
#define IsA(nodeptr, _type_)
Definition: nodes.h:563
void ExecEndNestLoop(NestLoopState *node)
Definition: nodeNestloop.c:366
BitmapHeapScanState * ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
Definition: nodes.h:79
Instrumentation * instrument
Definition: execnodes.h:869
void ExecEndIndexScan(IndexScanState *node)
void ExecEndLimit(LimitState *node)
Definition: nodeLimit.c:393
GroupState * ExecInitGroup(Group *node, EState *estate, int eflags)
Definition: nodeGroup.c:166
MergeAppendState * ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags)
void ExecEndUnique(UniqueState *node)
Definition: nodeUnique.c:178
void ExecEndGatherMerge(GatherMergeState *node)
bool ExecShutdownNode(PlanState *node)
Definition: execProcnode.c:747
void ExecEndNode(PlanState *node)
Definition: execProcnode.c:539
void ExecShutdownCustomScan(CustomScanState *node)
Definition: nodeCustom.c:229
GatherMergeState * ExecInitGatherMerge(GatherMerge *node, EState *estate, int eflags)
bool bounded
Definition: execnodes.h:1776
List * initPlan
Definition: execnodes.h:880
RecursiveUnionState * ExecInitRecursiveUnion(RecursiveUnion *node, EState *estate, int eflags)
NestLoopState * ExecInitNestLoop(NestLoop *node, EState *estate, int eflags)
Definition: nodeNestloop.c:263
LockRowsState * ExecInitLockRows(LockRows *node, EState *estate, int eflags)
Definition: nodeLockRows.c:352
HashState * ExecInitHash(Hash *node, EState *estate, int eflags)
Definition: nodeHash.c:352
void ExecEndWorkTableScan(WorkTableScanState *node)
int64 bound
Definition: execnodes.h:1777
void ExecReScan(PlanState *node)
Definition: execAmi.c:76
void ExecEndLockRows(LockRowsState *node)
Definition: nodeLockRows.c:451
void ExecEndNamedTuplestoreScan(NamedTuplestoreScanState *node)
void ExecEndBitmapAnd(BitmapAndState *node)
CteScanState * ExecInitCteScan(CteScan *node, EState *estate, int eflags)
Definition: nodeCtescan.c:168
Definition: nodes.h:512
void ExecShutdownHashJoin(HashJoinState *node)
Definition: nodes.h:48
Instrumentation * InstrAlloc(int n, int instrument_options)
Definition: instrument.c:30
Node * MultiExecHash(HashState *node)
Definition: nodeHash.c:105
AppendState * ExecInitAppend(Append *node, EState *estate, int eflags)
Definition: nodeAppend.c:98
Definition: nodes.h:75
GatherState * ExecInitGather(Gather *node, EState *estate, int eflags)
Definition: nodeGather.c:58
void ExecEndRecursiveUnion(RecursiveUnionState *node)
void ExecShutdownHash(HashState *node)
Definition: nodeHash.c:2603
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:846
void ExecSetTupleBound(int64 tuples_needed, PlanState *child_node)
Definition: execProcnode.c:800
SubPlanState * ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
Definition: nodeSubplan.c:691
void ExecEndSubqueryScan(SubqueryScanState *node)
void ExecEndHashJoin(HashJoinState *node)
Definition: nodeHashjoin.c:765
PlanState ps
Definition: execnodes.h:1115
void ExecEndTableFuncScan(TableFuncScanState *node)
void ExecEndResult(ResultState *node)
Definition: nodeResult.c:246
AggState * ExecInitAgg(Agg *node, EState *estate, int eflags)
Definition: nodeAgg.c:2073
TidScanState * ExecInitTidScan(TidScan *node, EState *estate, int eflags)
Definition: nodeTidscan.c:513
Definition: nodes.h:45
#define ERROR
Definition: elog.h:43
IndexScanState * ExecInitIndexScan(IndexScan *node, EState *estate, int eflags)
void ExecEndAppend(AppendState *node)
Definition: nodeAppend.c:236
void InstrStartNode(Instrumentation *instr)
Definition: instrument.c:63
CustomScanState * ExecInitCustomScan(CustomScan *cscan, EState *estate, int eflags)
Definition: nodeCustom.c:29
void ExecEndForeignScan(ForeignScanState *node)
void ExecEndSort(SortState *node)
Definition: nodeSort.c:238
BitmapIndexScanState * ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate, int eflags)
Definition: nodes.h:76
#define outerPlanState(node)
Definition: execnodes.h:905
SampleScanState * ExecInitSampleScan(SampleScan *node, EState *estate, int eflags)
void ExecEndBitmapIndexScan(BitmapIndexScanState *node)
void check_stack_depth(void)
Definition: postgres.c:3154
void ExecEndValuesScan(ValuesScanState *node)
PlanState ** mergeplans
Definition: execnodes.h:1037
void ExecEndMergeJoin(MergeJoinState *node)
Node * MultiExecBitmapIndexScan(BitmapIndexScanState *node)
#define TupIsNull(slot)
Definition: tuptable.h:138
void ExecEndSeqScan(SeqScanState *node)
Definition: nodeSeqscan.c:225
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:476
int es_instrument
Definition: execnodes.h:493
void ExecEndIndexOnlyScan(IndexOnlyScanState *node)
PlanState * subplan
Definition: execnodes.h:1419
FunctionScanState * ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
void ExecEndTidScan(TidScanState *node)
Definition: nodeTidscan.c:482
Bitmapset * chgParam
Definition: execnodes.h:887
List * lappend(List *list, void *datum)
Definition: list.c:128
Node * MultiExecBitmapAnd(BitmapAndState *node)
ValuesScanState * ExecInitValuesScan(ValuesScan *node, EState *estate, int eflags)
BitmapAndState * ExecInitBitmapAnd(BitmapAnd *node, EState *estate, int eflags)
Definition: nodeBitmapAnd.c:55
HashJoinState * ExecInitHashJoin(HashJoin *node, EState *estate, int eflags)
Definition: nodeHashjoin.c:592
Node * MultiExecBitmapOr(BitmapOrState *node)
Definition: nodeBitmapOr.c:111
void ExecShutdownGather(GatherState *node)
Definition: nodeGather.c:398
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:865
void ExecEndCteScan(CteScanState *node)
Definition: nodeCtescan.c:280
ExecProcNodeMtd ExecProcNodeReal
Definition: execnodes.h:866
void ExecEndCustomScan(CustomScanState *node)
Definition: nodeCustom.c:122
UniqueState * ExecInitUnique(Unique *node, EState *estate, int eflags)
Definition: nodeUnique.c:116
void ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd function)
Definition: execProcnode.c:406
void ExecEndBitmapOr(BitmapOrState *node)
Definition: nodeBitmapOr.c:196
Definition: nodes.h:82
void ExecEndSampleScan(SampleScanState *node)
void ExecShutdownGatherMerge(GatherMergeState *node)
void bms_free(Bitmapset *a)
Definition: bitmapset.c:245
void ExecEndWindowAgg(WindowAggState *node)
BitmapOrState * ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags)
Definition: nodeBitmapOr.c:56
IndexOnlyScanState * ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags)
#define Assert(condition)
Definition: c.h:680
#define lfirst(lc)
Definition: pg_list.h:106
void ExecEndMergeAppend(MergeAppendState *node)
ResultState * ExecInitResult(Result *node, EState *estate, int eflags)
Definition: nodeResult.c:181
WindowAggState * ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
ProjectSetState * ExecInitProjectSet(ProjectSet *node, EState *estate, int eflags)
#define nodeTag(nodeptr)
Definition: nodes.h:517
ExprState * qual
Definition: execnodes.h:877
Definition: nodes.h:83
TableFuncScanState * ExecInitTableFuncScan(TableFuncScan *node, EState *estate, int eflags)
ForeignScanState * ExecInitForeignScan(ForeignScan *node, EState *estate, int eflags)
Node * MultiExecProcNode(PlanState *node)
Definition: execProcnode.c:484
SeqScanState * ExecInitSeqScan(SeqScan *node, EState *estate, int eflags)
Definition: nodeSeqscan.c:166
static TupleTableSlot * ExecProcNodeInstr(PlanState *node)
Definition: execProcnode.c:456
List * initPlan
Definition: plannodes.h:148
Definition: nodes.h:80
LimitState * ExecInitLimit(Limit *node, EState *estate, int eflags)
Definition: nodeLimit.c:330
int i
void ExecEndHash(HashState *node)
Definition: nodeHash.c:409
void ExecShutdownForeignScan(ForeignScanState *node)
void ExecEndProjectSet(ProjectSetState *node)
void ExecEndMaterial(MaterialState *node)
Definition: nodeMaterial.c:244
WorkTableScanState * ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags)
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:98
Definition: plannodes.h:782
#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:3697
void ExecEndAgg(AggState *node)
Definition: nodeAgg.c:3287
void ExecEndModifyTable(ModifyTableState *node)
MaterialState * ExecInitMaterial(Material *node, EState *estate, int eflags)
Definition: nodeMaterial.c:166
static TupleTableSlot * ExecProcNodeFirst(PlanState *node)
Definition: execProcnode.c:425
void ExecEndGather(GatherState *node)
Definition: nodeGather.c:238
int64 tuples_needed
Definition: execnodes.h:1957
Definition: nodes.h:85