PostgreSQL Source Code  git master
execnodes.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * execnodes.h
4  * definitions for executor state nodes
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/nodes/execnodes.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef EXECNODES_H
15 #define EXECNODES_H
16 
17 #include "access/genam.h"
18 #include "access/heapam.h"
19 #include "access/tupconvert.h"
20 #include "executor/instrument.h"
21 #include "lib/pairingheap.h"
22 #include "nodes/params.h"
23 #include "nodes/plannodes.h"
24 #include "storage/spin.h"
25 #include "utils/hsearch.h"
26 #include "utils/queryenvironment.h"
27 #include "utils/reltrigger.h"
28 #include "utils/sortsupport.h"
29 #include "utils/tuplestore.h"
30 #include "utils/tuplesort.h"
31 #include "nodes/tidbitmap.h"
33 
34 
35 /* ----------------
36  * ExprState node
37  *
38  * ExprState is the top-level node for expression evaluation.
39  * It contains instructions (in ->steps) to evaluate the expression.
40  * ----------------
41  */
42 struct ExprState; /* forward references in this file */
43 struct ExprContext;
44 struct ExprEvalStep; /* avoid including execExpr.h everywhere */
45 
46 typedef Datum (*ExprStateEvalFunc) (struct ExprState *expression,
47  struct ExprContext *econtext,
48  bool *isNull);
49 
50 /* Bits in ExprState->flags (see also execExpr.h for private flag bits): */
51 /* expression is for use with ExecQual() */
52 #define EEO_FLAG_IS_QUAL (1 << 0)
53 
54 typedef struct ExprState
55 {
57 
58  uint8 flags; /* bitmask of EEO_FLAG_* bits, see above */
59 
60  /*
61  * Storage for result value of a scalar expression, or for individual
62  * column results within expressions built by ExecBuildProjectionInfo().
63  */
64  bool resnull;
66 
67  /*
68  * If projecting a tuple result, this slot holds the result; else NULL.
69  */
71 
72  /*
73  * Instructions to compute expression's return value.
74  */
76 
77  /*
78  * Function that actually evaluates the expression. This can be set to
79  * different values depending on the complexity of the expression.
80  */
82 
83  /* original expression tree, for debugging only */
85 
86  /*
87  * XXX: following only needed during "compilation", could be thrown away.
88  */
89 
90  int steps_len; /* number of steps currently */
91  int steps_alloc; /* allocated length of steps array */
92 
95 
98 } ExprState;
99 
100 
101 /* ----------------
102  * IndexInfo information
103  *
104  * this struct holds the information needed to construct new index
105  * entries for a particular index. Used for both index_build and
106  * retail creation of index entries.
107  *
108  * NumIndexAttrs number of columns in this index
109  * KeyAttrNumbers underlying-rel attribute numbers used as keys
110  * (zeroes indicate expressions)
111  * Expressions expr trees for expression entries, or NIL if none
112  * ExpressionsState exec state for expressions, or NIL if none
113  * Predicate partial-index predicate, or NIL if none
114  * PredicateState exec state for predicate, or NIL if none
115  * ExclusionOps Per-column exclusion operators, or NULL if none
116  * ExclusionProcs Underlying function OIDs for ExclusionOps
117  * ExclusionStrats Opclass strategy numbers for ExclusionOps
118  * UniqueOps Theses are like Exclusion*, but for unique indexes
119  * UniqueProcs
120  * UniqueStrats
121  * Unique is it a unique index?
122  * ReadyForInserts is it valid for inserts?
123  * Concurrent are we doing a concurrent index build?
124  * BrokenHotChain did we detect any broken HOT chains?
125  * AmCache private cache area for index AM
126  * Context memory context holding this IndexInfo
127  *
128  * ii_Concurrent and ii_BrokenHotChain are used only during index build;
129  * they're conventionally set to false otherwise.
130  * ----------------
131  */
132 typedef struct IndexInfo
133 {
136  AttrNumber ii_KeyAttrNumbers[INDEX_MAX_KEYS];
137  List *ii_Expressions; /* list of Expr */
138  List *ii_ExpressionsState; /* list of ExprState */
139  List *ii_Predicate; /* list of Expr */
141  Oid *ii_ExclusionOps; /* array with one entry per column */
142  Oid *ii_ExclusionProcs; /* array with one entry per column */
143  uint16 *ii_ExclusionStrats; /* array with one entry per column */
144  Oid *ii_UniqueOps; /* array with one entry per column */
145  Oid *ii_UniqueProcs; /* array with one entry per column */
146  uint16 *ii_UniqueStrats; /* array with one entry per column */
147  bool ii_Unique;
151  void *ii_AmCache;
153 } IndexInfo;
154 
155 /* ----------------
156  * ExprContext_CB
157  *
158  * List of callbacks to be called at ExprContext shutdown.
159  * ----------------
160  */
162 
163 typedef struct ExprContext_CB
164 {
169 
170 /* ----------------
171  * ExprContext
172  *
173  * This class holds the "current context" information
174  * needed to evaluate expressions for doing tuple qualifications
175  * and tuple projections. For example, if an expression refers
176  * to an attribute in the current inner tuple then we need to know
177  * what the current inner tuple is and so we look at the expression
178  * context.
179  *
180  * There are two memory contexts associated with an ExprContext:
181  * * ecxt_per_query_memory is a query-lifespan context, typically the same
182  * context the ExprContext node itself is allocated in. This context
183  * can be used for purposes such as storing function call cache info.
184  * * ecxt_per_tuple_memory is a short-term context for expression results.
185  * As the name suggests, it will typically be reset once per tuple,
186  * before we begin to evaluate expressions for that tuple. Each
187  * ExprContext normally has its very own per-tuple memory context.
188  *
189  * CurrentMemoryContext should be set to ecxt_per_tuple_memory before
190  * calling ExecEvalExpr() --- see ExecEvalExprSwitchContext().
191  * ----------------
192  */
193 typedef struct ExprContext
194 {
196 
197  /* Tuples that Var nodes in expression may refer to */
201 
202  /* Memory contexts for expression evaluation --- see notes above */
205 
206  /* Values to substitute for Param nodes in expression */
207  ParamExecData *ecxt_param_exec_vals; /* for PARAM_EXEC params */
208  ParamListInfo ecxt_param_list_info; /* for other param types */
209 
210  /*
211  * Values to substitute for Aggref nodes in the expressions of an Agg
212  * node, or for WindowFunc nodes within a WindowAgg node.
213  */
214  Datum *ecxt_aggvalues; /* precomputed values for aggs/windowfuncs */
215  bool *ecxt_aggnulls; /* null flags for aggs/windowfuncs */
216 
217  /* Value to substitute for CaseTestExpr nodes in expression */
220 
221  /* Value to substitute for CoerceToDomainValue nodes in expression */
224 
225  /* Link to containing EState (NULL if a standalone ExprContext) */
227 
228  /* Functions to call back when ExprContext is shut down or rescanned */
230 } ExprContext;
231 
232 /*
233  * Set-result status used when evaluating functions potentially returning a
234  * set.
235  */
236 typedef enum
237 {
238  ExprSingleResult, /* expression does not return a set */
239  ExprMultipleResult, /* this result is an element of a set */
240  ExprEndResult /* there are no more elements in the set */
241 } ExprDoneCond;
242 
243 /*
244  * Return modes for functions returning sets. Note values must be chosen
245  * as separate bits so that a bitmask can be formed to indicate supported
246  * modes. SFRM_Materialize_Random and SFRM_Materialize_Preferred are
247  * auxiliary flags about SFRM_Materialize mode, rather than separate modes.
248  */
249 typedef enum
250 {
251  SFRM_ValuePerCall = 0x01, /* one value returned per call */
252  SFRM_Materialize = 0x02, /* result set instantiated in Tuplestore */
253  SFRM_Materialize_Random = 0x04, /* Tuplestore needs randomAccess */
254  SFRM_Materialize_Preferred = 0x08 /* caller prefers Tuplestore */
256 
257 /*
258  * When calling a function that might return a set (multiple rows),
259  * a node of this type is passed as fcinfo->resultinfo to allow
260  * return status to be passed back. A function returning set should
261  * raise an error if no such resultinfo is provided.
262  */
263 typedef struct ReturnSetInfo
264 {
266  /* values set by caller: */
267  ExprContext *econtext; /* context function is being called in */
268  TupleDesc expectedDesc; /* tuple descriptor expected by caller */
269  int allowedModes; /* bitmask: return modes caller can handle */
270  /* result status from function (but pre-initialized by caller): */
271  SetFunctionReturnMode returnMode; /* actual return mode */
272  ExprDoneCond isDone; /* status for ValuePerCall mode */
273  /* fields filled by function in Materialize return mode: */
274  Tuplestorestate *setResult; /* holds the complete returned tuple set */
275  TupleDesc setDesc; /* actual descriptor for returned tuples */
276 } ReturnSetInfo;
277 
278 /* ----------------
279  * ProjectionInfo node information
280  *
281  * This is all the information needed to perform projections ---
282  * that is, form new tuples by evaluation of targetlist expressions.
283  * Nodes which need to do projections create one of these.
284  *
285  * The target tuple slot is kept in ProjectionInfo->pi_state.resultslot.
286  * ExecProject() evaluates the tlist, forms a tuple, and stores it
287  * in the given slot. Note that the result will be a "virtual" tuple
288  * unless ExecMaterializeSlot() is then called to force it to be
289  * converted to a physical tuple. The slot must have a tupledesc
290  * that matches the output of the tlist!
291  * ----------------
292  */
293 typedef struct ProjectionInfo
294 {
296  /* instructions to evaluate projection */
298  /* expression context in which to evaluate expression */
301 
302 /* ----------------
303  * JunkFilter
304  *
305  * This class is used to store information regarding junk attributes.
306  * A junk attribute is an attribute in a tuple that is needed only for
307  * storing intermediate information in the executor, and does not belong
308  * in emitted tuples. For example, when we do an UPDATE query,
309  * the planner adds a "junk" entry to the targetlist so that the tuples
310  * returned to ExecutePlan() contain an extra attribute: the ctid of
311  * the tuple to be updated. This is needed to do the update, but we
312  * don't want the ctid to be part of the stored new tuple! So, we
313  * apply a "junk filter" to remove the junk attributes and form the
314  * real output tuple. The junkfilter code also provides routines to
315  * extract the values of the junk attribute(s) from the input tuple.
316  *
317  * targetList: the original target list (including junk attributes).
318  * cleanTupType: the tuple descriptor for the "clean" tuple (with
319  * junk attributes removed).
320  * cleanMap: A map with the correspondence between the non-junk
321  * attribute numbers of the "original" tuple and the
322  * attribute numbers of the "clean" tuple.
323  * resultSlot: tuple slot used to hold cleaned tuple.
324  * junkAttNo: not used by junkfilter code. Can be used by caller
325  * to remember the attno of a specific junk attribute
326  * (nodeModifyTable.c keeps the "ctid" or "wholerow"
327  * attno here).
328  * ----------------
329  */
330 typedef struct JunkFilter
331 {
338 } JunkFilter;
339 
340 /*
341  * ResultRelInfo
342  *
343  * Whenever we update an existing relation, we have to update indexes on the
344  * relation, and perhaps also fire triggers. ResultRelInfo holds all the
345  * information needed about a result relation, including indexes.
346  */
347 typedef struct ResultRelInfo
348 {
350 
351  /* result relation's range table index */
353 
354  /* relation descriptor for result relation */
356 
357  /* # of indices existing on result relation */
359 
360  /* array of relation descriptors for indices */
362 
363  /* array of key/attr info for indices */
365 
366  /* triggers to be fired, if any */
368 
369  /* cached lookup info for trigger functions */
371 
372  /* array of trigger WHEN expr states */
374 
375  /* optional runtime measurements for triggers */
377 
378  /* FDW callback functions, if foreign table */
380 
381  /* available to save private state of FDW */
382  void *ri_FdwState;
383 
384  /* true when modifying foreign table directly */
386 
387  /* list of WithCheckOption's to be checked */
389 
390  /* list of WithCheckOption expr states */
392 
393  /* array of constraint-checking expr states */
395 
396  /* for removing junk attributes from tuples */
398 
399  /* for computing a RETURNING list */
401 
402  /* for computing ON CONFLICT DO UPDATE SET */
404 
405  /* list of ON CONFLICT DO UPDATE exprs (qual) */
407 
408  /* partition check expression */
410 
411  /* partition check expression state */
413 
414  /* relation descriptor for root partitioned table */
416 } ResultRelInfo;
417 
418 /* ----------------
419  * EState information
420  *
421  * Master working state for an Executor invocation
422  * ----------------
423  */
424 typedef struct EState
425 {
427 
428  /* Basic state for all query types: */
429  ScanDirection es_direction; /* current scan direction */
430  Snapshot es_snapshot; /* time qual to use */
431  Snapshot es_crosscheck_snapshot; /* crosscheck time qual for RI */
432  List *es_range_table; /* List of RangeTblEntry */
433  PlannedStmt *es_plannedstmt; /* link to top of plan tree */
434  const char *es_sourceText; /* Source text from QueryDesc */
435 
436  JunkFilter *es_junkFilter; /* top-level junk filter, if any */
437 
438  /* If query can insert/delete tuples, the command ID to mark them with */
440 
441  /* Info about target table(s) for insert/update/delete queries: */
442  ResultRelInfo *es_result_relations; /* array of ResultRelInfos */
443  int es_num_result_relations; /* length of array */
444  ResultRelInfo *es_result_relation_info; /* currently active array elt */
445 
446  /*
447  * Info about the target partitioned target table root(s) for
448  * update/delete queries. They required only to fire any per-statement
449  * triggers defined on the table. It exists separately from
450  * es_result_relations, because partitioned tables don't appear in the
451  * plan tree for the update/delete cases.
452  */
453  ResultRelInfo *es_root_result_relations; /* array of ResultRelInfos */
454  int es_num_root_result_relations; /* length of the array */
455 
456  /* Info about leaf partitions of partitioned table(s) for insert queries: */
457  List *es_leaf_result_relations; /* List of ResultRelInfos */
458 
459  /* Stuff used for firing triggers: */
460  List *es_trig_target_relations; /* trigger-only ResultRelInfos */
461  TupleTableSlot *es_trig_tuple_slot; /* for trigger output tuples */
462  TupleTableSlot *es_trig_oldtup_slot; /* for TriggerEnabled */
463  TupleTableSlot *es_trig_newtup_slot; /* for TriggerEnabled */
464 
465  /* Parameter info: */
466  ParamListInfo es_param_list_info; /* values of external params */
467  ParamExecData *es_param_exec_vals; /* values of internal params */
468 
469  QueryEnvironment *es_queryEnv; /* query environment */
470 
471  /* Other working state: */
472  MemoryContext es_query_cxt; /* per-query context in which EState lives */
473 
474  List *es_tupleTable; /* List of TupleTableSlots */
475 
476  List *es_rowMarks; /* List of ExecRowMarks */
477 
478  uint64 es_processed; /* # of tuples processed */
479  Oid es_lastoid; /* last oid processed (by INSERT) */
480 
481  int es_top_eflags; /* eflags passed to ExecutorStart */
482  int es_instrument; /* OR of InstrumentOption flags */
483  bool es_finished; /* true when ExecutorFinish is done */
484 
485  List *es_exprcontexts; /* List of ExprContexts within EState */
486 
487  List *es_subplanstates; /* List of PlanState for SubPlans */
488 
489  List *es_auxmodifytables; /* List of secondary ModifyTableStates */
490 
491  /*
492  * this ExprContext is for per-output-tuple operations, such as constraint
493  * checks and index-value computations. It will be reset for each output
494  * tuple. Note that it will be created only if needed.
495  */
497 
498  /*
499  * These fields are for re-evaluating plan quals when an updated tuple is
500  * substituted in READ COMMITTED mode. es_epqTuple[] contains tuples that
501  * scan plan nodes should return instead of whatever they'd normally
502  * return, or NULL if nothing to return; es_epqTupleSet[] is true if a
503  * particular array entry is valid; and es_epqScanDone[] is state to
504  * remember if the tuple has been returned already. Arrays are of size
505  * list_length(es_range_table) and are indexed by scan node scanrelid - 1.
506  */
507  HeapTuple *es_epqTuple; /* array of EPQ substitute tuples */
508  bool *es_epqTupleSet; /* true if EPQ tuple is provided */
509  bool *es_epqScanDone; /* true if EPQ tuple has been fetched */
510 
511  bool es_use_parallel_mode; /* can we use parallel workers? */
512 
513  /* The per-query shared memory area to use for parallel execution. */
515 } EState;
516 
517 
518 /*
519  * ExecRowMark -
520  * runtime representation of FOR [KEY] UPDATE/SHARE clauses
521  *
522  * When doing UPDATE, DELETE, or SELECT FOR [KEY] UPDATE/SHARE, we will have an
523  * ExecRowMark for each non-target relation in the query (except inheritance
524  * parent RTEs, which can be ignored at runtime). Virtual relations such as
525  * subqueries-in-FROM will have an ExecRowMark with relation == NULL. See
526  * PlanRowMark for details about most of the fields. In addition to fields
527  * directly derived from PlanRowMark, we store an activity flag (to denote
528  * inactive children of inheritance trees), curCtid, which is used by the
529  * WHERE CURRENT OF code, and ermExtra, which is available for use by the plan
530  * node that sources the relation (e.g., for a foreign table the FDW can use
531  * ermExtra to hold information).
532  *
533  * EState->es_rowMarks is a list of these structs.
534  */
535 typedef struct ExecRowMark
536 {
537  Relation relation; /* opened and suitably locked relation */
538  Oid relid; /* its OID (or InvalidOid, if subquery) */
539  Index rti; /* its range table index */
540  Index prti; /* parent range table index, if child */
541  Index rowmarkId; /* unique identifier for resjunk columns */
542  RowMarkType markType; /* see enum in nodes/plannodes.h */
543  LockClauseStrength strength; /* LockingClause's strength, or LCS_NONE */
544  LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
545  bool ermActive; /* is this mark relevant for current tuple? */
546  ItemPointerData curCtid; /* ctid of currently locked tuple, if any */
547  void *ermExtra; /* available for use by relation source node */
548 } ExecRowMark;
549 
550 /*
551  * ExecAuxRowMark -
552  * additional runtime representation of FOR [KEY] UPDATE/SHARE clauses
553  *
554  * Each LockRows and ModifyTable node keeps a list of the rowmarks it needs to
555  * deal with. In addition to a pointer to the related entry in es_rowMarks,
556  * this struct carries the column number(s) of the resjunk columns associated
557  * with the rowmark (see comments for PlanRowMark for more detail). In the
558  * case of ModifyTable, there has to be a separate ExecAuxRowMark list for
559  * each child plan, because the resjunk columns could be at different physical
560  * column positions in different subplans.
561  */
562 typedef struct ExecAuxRowMark
563 {
564  ExecRowMark *rowmark; /* related entry in es_rowMarks */
565  AttrNumber ctidAttNo; /* resno of ctid junk attribute, if any */
566  AttrNumber toidAttNo; /* resno of tableoid junk attribute, if any */
567  AttrNumber wholeAttNo; /* resno of whole-row junk attribute, if any */
569 
570 
571 /* ----------------------------------------------------------------
572  * Tuple Hash Tables
573  *
574  * All-in-memory tuple hash tables are used for a number of purposes.
575  *
576  * Note: tab_hash_funcs are for the key datatype(s) stored in the table,
577  * and tab_eq_funcs are non-cross-type equality operators for those types.
578  * Normally these are the only functions used, but FindTupleHashEntry()
579  * supports searching a hashtable using cross-data-type hashing. For that,
580  * the caller must supply hash functions for the LHS datatype as well as
581  * the cross-type equality operators to use. in_hash_funcs and cur_eq_funcs
582  * are set to point to the caller's function arrays while doing such a search.
583  * During LookupTupleHashEntry(), they point to tab_hash_funcs and
584  * tab_eq_funcs respectively.
585  * ----------------------------------------------------------------
586  */
589 
590 typedef struct TupleHashEntryData
591 {
592  MinimalTuple firstTuple; /* copy of first tuple in this group */
593  void *additional; /* user data */
594  uint32 status; /* hash status */
595  uint32 hash; /* hash value (cached) */
597 
598 /* define parameters necessary to generate the tuple hash table interface */
599 #define SH_PREFIX tuplehash
600 #define SH_ELEMENT_TYPE TupleHashEntryData
601 #define SH_KEY_TYPE MinimalTuple
602 #define SH_SCOPE extern
603 #define SH_DECLARE
604 #include "lib/simplehash.h"
605 
606 typedef struct TupleHashTableData
607 {
608  tuplehash_hash *hashtab; /* underlying hash table */
609  int numCols; /* number of columns in lookup key */
610  AttrNumber *keyColIdx; /* attr numbers of key columns */
611  FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */
612  FmgrInfo *tab_eq_funcs; /* equality functions for table datatype(s) */
613  MemoryContext tablecxt; /* memory context containing table */
614  MemoryContext tempcxt; /* context for function evaluations */
615  Size entrysize; /* actual size to make each hash entry */
616  TupleTableSlot *tableslot; /* slot for referencing table entries */
617  /* The following fields are set transiently for each table search: */
618  TupleTableSlot *inputslot; /* current input tuple's slot */
619  FmgrInfo *in_hash_funcs; /* hash functions for input datatype(s) */
620  FmgrInfo *cur_eq_funcs; /* equality functions for input vs. table */
621  uint32 hash_iv; /* hash-function IV */
623 
624 typedef tuplehash_iterator TupleHashIterator;
625 
626 /*
627  * Use InitTupleHashIterator/TermTupleHashIterator for a read/write scan.
628  * Use ResetTupleHashIterator if the table can be frozen (in this case no
629  * explicit scan termination is needed).
630  */
631 #define InitTupleHashIterator(htable, iter) \
632  tuplehash_start_iterate(htable->hashtab, iter)
633 #define TermTupleHashIterator(iter) \
634  ((void) 0)
635 #define ResetTupleHashIterator(htable, iter) \
636  InitTupleHashIterator(htable, iter)
637 #define ScanTupleHashTable(htable, iter) \
638  tuplehash_iterate(htable->hashtab, iter)
639 
640 
641 /* ----------------------------------------------------------------
642  * Expression State Nodes
643  *
644  * Formerly, there was a separate executor expression state node corresponding
645  * to each node in a planned expression tree. That's no longer the case; for
646  * common expression node types, all the execution info is embedded into
647  * step(s) in a single ExprState node. But we still have a few executor state
648  * node types for selected expression node types, mostly those in which info
649  * has to be shared with other parts of the execution state tree.
650  * ----------------------------------------------------------------
651  */
652 
653 /* ----------------
654  * AggrefExprState node
655  * ----------------
656  */
657 typedef struct AggrefExprState
658 {
660  Aggref *aggref; /* expression plan node */
661  int aggno; /* ID number for agg within its plan node */
663 
664 /* ----------------
665  * WindowFuncExprState node
666  * ----------------
667  */
668 typedef struct WindowFuncExprState
669 {
671  WindowFunc *wfunc; /* expression plan node */
672  List *args; /* ExprStates for argument expressions */
673  ExprState *aggfilter; /* FILTER expression */
674  int wfuncno; /* ID number for wfunc within its plan node */
676 
677 
678 /* ----------------
679  * SetExprState node
680  *
681  * State for evaluating a potentially set-returning expression (like FuncExpr
682  * or OpExpr). In some cases, like some of the expressions in ROWS FROM(...)
683  * the expression might not be a SRF, but nonetheless it uses the same
684  * machinery as SRFs; it will be treated as a SRF returning a single row.
685  * ----------------
686  */
687 typedef struct SetExprState
688 {
690  Expr *expr; /* expression plan node */
691  List *args; /* ExprStates for argument expressions */
692 
693  /*
694  * In ROWS FROM, functions can be inlined, removing the FuncExpr normally
695  * inside. In such a case this is the compiled expression (which cannot
696  * return a set), which'll be evaluated using regular ExecEvalExpr().
697  */
699 
700  /*
701  * Function manager's lookup info for the target function. If func.fn_oid
702  * is InvalidOid, we haven't initialized it yet (nor any of the following
703  * fields, except funcReturnsSet).
704  */
706 
707  /*
708  * For a set-returning function (SRF) that returns a tuplestore, we keep
709  * the tuplestore here and dole out the result rows one at a time. The
710  * slot holds the row currently being returned.
711  */
714 
715  /*
716  * In some cases we need to compute a tuple descriptor for the function's
717  * output. If so, it's stored here.
718  */
720  bool funcReturnsTuple; /* valid when funcResultDesc isn't NULL */
721 
722  /*
723  * Remember whether the function is declared to return a set. This is set
724  * by ExecInitExpr, and is valid even before the FmgrInfo is set up.
725  */
727 
728  /*
729  * setArgsValid is true when we are evaluating a set-returning function
730  * that uses value-per-call mode and we are in the middle of a call
731  * series; we want to pass the same argument values to the function again
732  * (and again, until it returns ExprEndResult). This indicates that
733  * fcinfo_data already contains valid argument data.
734  */
736 
737  /*
738  * Flag to remember whether we have registered a shutdown callback for
739  * this SetExprState. We do so only if funcResultStore or setArgsValid
740  * has been set at least once (since all the callback is for is to release
741  * the tuplestore or clear setArgsValid).
742  */
743  bool shutdown_reg; /* a shutdown callback is registered */
744 
745  /*
746  * Call parameter structure for the function. This has been initialized
747  * (by InitFunctionCallInfoData) if func.fn_oid is valid. It also saves
748  * argument values between calls, when setArgsValid is true.
749  */
751 } SetExprState;
752 
753 /* ----------------
754  * SubPlanState node
755  * ----------------
756  */
757 typedef struct SubPlanState
758 {
760  SubPlan *subplan; /* expression plan node */
761  struct PlanState *planstate; /* subselect plan's state tree */
762  struct PlanState *parent; /* parent plan node's state tree */
763  ExprState *testexpr; /* state of combining expression */
764  List *args; /* states of argument expression(s) */
765  HeapTuple curTuple; /* copy of most recent tuple from subplan */
766  Datum curArray; /* most recent array from ARRAY() subplan */
767  /* these are used when hashing the subselect's output: */
768  ProjectionInfo *projLeft; /* for projecting lefthand exprs */
769  ProjectionInfo *projRight; /* for projecting subselect output */
770  TupleHashTable hashtable; /* hash table for no-nulls subselect rows */
771  TupleHashTable hashnulls; /* hash table for rows with null(s) */
772  bool havehashrows; /* true if hashtable is not empty */
773  bool havenullrows; /* true if hashnulls is not empty */
774  MemoryContext hashtablecxt; /* memory context containing hash tables */
775  MemoryContext hashtempcxt; /* temp memory context for hash tables */
776  ExprContext *innerecontext; /* econtext for computing inner tuples */
777  AttrNumber *keyColIdx; /* control data for hash tables */
778  FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */
779  FmgrInfo *tab_eq_funcs; /* equality functions for table datatype(s) */
780  FmgrInfo *lhs_hash_funcs; /* hash functions for lefthand datatype(s) */
781  FmgrInfo *cur_eq_funcs; /* equality functions for LHS vs. table */
782 } SubPlanState;
783 
784 /* ----------------
785  * AlternativeSubPlanState node
786  * ----------------
787  */
789 {
791  AlternativeSubPlan *subplan; /* expression plan node */
792  List *subplans; /* SubPlanStates of alternative subplans */
793  int active; /* list index of the one we're using */
795 
796 /*
797  * DomainConstraintState - one item to check during CoerceToDomain
798  *
799  * Note: we consider this to be part of an ExprState tree, so we give it
800  * a name following the xxxState convention. But there's no directly
801  * associated plan-tree node.
802  */
804 {
808 
809 typedef struct DomainConstraintState
810 {
812  DomainConstraintType constrainttype; /* constraint type */
813  char *name; /* name of constraint (for error msgs) */
814  Expr *check_expr; /* for CHECK, a boolean expression */
815  ExprState *check_exprstate; /* check_expr's eval state, or NULL */
817 
818 
819 /* ----------------------------------------------------------------
820  * Executor State Trees
821  *
822  * An executing query has a PlanState tree paralleling the Plan tree
823  * that describes the plan.
824  * ----------------------------------------------------------------
825  */
826 
827 struct PlanState;
828 
829 /* ----------------
830  * ExecProcNodeMtd
831  *
832  * This is the method called by ExecProcNode to return the next tuple
833  * from an executor node. It returns NULL, or an empty TupleTableSlot,
834  * if no more tuples are available.
835  * ----------------
836  */
837 typedef TupleTableSlot *(*ExecProcNodeMtd) (struct PlanState *pstate);
838 
839 /* ----------------
840  * PlanState node
841  *
842  * We never actually instantiate any PlanState nodes; this is just the common
843  * abstract superclass for all PlanState-type nodes.
844  * ----------------
845  */
846 typedef struct PlanState
847 {
849 
850  Plan *plan; /* associated Plan node */
851 
852  EState *state; /* at execution time, states of individual
853  * nodes point to one EState for the whole
854  * top-level plan */
855 
856  ExecProcNodeMtd ExecProcNode; /* function to return next tuple */
857  ExecProcNodeMtd ExecProcNodeReal; /* actual function, if above is a
858  * wrapper */
859 
860  Instrumentation *instrument; /* Optional runtime stats for this node */
861  WorkerInstrumentation *worker_instrument; /* per-worker instrumentation */
862 
863  /*
864  * Common structural data for all Plan types. These links to subsidiary
865  * state trees parallel links in the associated plan tree (except for the
866  * subPlan list, which does not exist in the plan tree).
867  */
868  ExprState *qual; /* boolean qual condition */
869  struct PlanState *lefttree; /* input plan tree(s) */
871  List *initPlan; /* Init SubPlanState nodes (un-correlated expr
872  * subselects) */
873  List *subPlan; /* SubPlanState nodes in my expressions */
874 
875  /*
876  * State for management of parameter-change-driven rescanning
877  */
878  Bitmapset *chgParam; /* set of IDs of changed Params */
879 
880  /*
881  * Other run-time state needed by most if not all node types.
882  */
883  TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */
884  ExprContext *ps_ExprContext; /* node's expression-evaluation context */
885  ProjectionInfo *ps_ProjInfo; /* info for doing tuple projection */
886 } PlanState;
887 
888 /* ----------------
889  * these are defined to avoid confusion problems with "left"
890  * and "right" and "inner" and "outer". The convention is that
891  * the "left" plan is the "outer" plan and the "right" plan is
892  * the inner plan, but these make the code more readable.
893  * ----------------
894  */
895 #define innerPlanState(node) (((PlanState *)(node))->righttree)
896 #define outerPlanState(node) (((PlanState *)(node))->lefttree)
897 
898 /* Macros for inline access to certain instrumentation counters */
899 #define InstrCountFiltered1(node, delta) \
900  do { \
901  if (((PlanState *)(node))->instrument) \
902  ((PlanState *)(node))->instrument->nfiltered1 += (delta); \
903  } while(0)
904 #define InstrCountFiltered2(node, delta) \
905  do { \
906  if (((PlanState *)(node))->instrument) \
907  ((PlanState *)(node))->instrument->nfiltered2 += (delta); \
908  } while(0)
909 
910 /*
911  * EPQState is state for executing an EvalPlanQual recheck on a candidate
912  * tuple in ModifyTable or LockRows. The estate and planstate fields are
913  * NULL if inactive.
914  */
915 typedef struct EPQState
916 {
917  EState *estate; /* subsidiary EState */
918  PlanState *planstate; /* plan state tree ready to be executed */
919  TupleTableSlot *origslot; /* original output tuple to be rechecked */
920  Plan *plan; /* plan tree to be executed */
921  List *arowMarks; /* ExecAuxRowMarks (non-locking only) */
922  int epqParam; /* ID of Param to force scan node re-eval */
923 } EPQState;
924 
925 
926 /* ----------------
927  * ResultState information
928  * ----------------
929  */
930 typedef struct ResultState
931 {
932  PlanState ps; /* its first field is NodeTag */
934  bool rs_done; /* are we done? */
935  bool rs_checkqual; /* do we need to check the qual? */
936 } ResultState;
937 
938 /* ----------------
939  * ProjectSetState information
940  *
941  * Note: at least one of the "elems" will be a SetExprState; the rest are
942  * regular ExprStates.
943  * ----------------
944  */
945 typedef struct ProjectSetState
946 {
947  PlanState ps; /* its first field is NodeTag */
948  Node **elems; /* array of expression states */
949  ExprDoneCond *elemdone; /* array of per-SRF is-done states */
950  int nelems; /* length of elemdone[] array */
951  bool pending_srf_tuples; /* still evaluating srfs in tlist? */
952  MemoryContext argcontext; /* context for SRF arguments */
954 
955 /* ----------------
956  * ModifyTableState information
957  * ----------------
958  */
959 typedef struct ModifyTableState
960 {
961  PlanState ps; /* its first field is NodeTag */
962  CmdType operation; /* INSERT, UPDATE, or DELETE */
963  bool canSetTag; /* do we set the command tag/es_processed? */
964  bool mt_done; /* are we done? */
965  PlanState **mt_plans; /* subplans (one per target rel) */
966  int mt_nplans; /* number of plans in the array */
967  int mt_whichplan; /* which one is being executed (0..n-1) */
968  ResultRelInfo *resultRelInfo; /* per-subplan target relations */
969  ResultRelInfo *rootResultRelInfo; /* root target relation (partitioned
970  * table root) */
971  List **mt_arowmarks; /* per-subplan ExecAuxRowMark lists */
972  EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */
973  bool fireBSTriggers; /* do we need to fire stmt triggers? */
974  OnConflictAction mt_onconflict; /* ON CONFLICT type */
975  List *mt_arbiterindexes; /* unique index OIDs to arbitrate taking
976  * alt path */
977  TupleTableSlot *mt_existing; /* slot to store existing target tuple in */
978  List *mt_excludedtlist; /* the excluded pseudo relation's tlist */
979  TupleTableSlot *mt_conflproj; /* CONFLICT ... SET ... projection target */
981  /* Tuple-routing support info */
982  int mt_num_dispatch; /* Number of entries in the above array */
983  int mt_num_partitions; /* Number of members in the following
984  * arrays */
985  ResultRelInfo **mt_partitions; /* Per partition result relation pointers */
987  /* Per partition tuple conversion map */
990  /* controls transition table population for specified operation */
992  /* controls transition table population for INSERT...ON CONFLICT UPDATE */
994  /* Per plan/partition tuple conversion */
996 
997 /* ----------------
998  * AppendState information
999  *
1000  * nplans how many plans are in the array
1001  * whichplan which plan is being executed (0 .. n-1)
1002  * ----------------
1003  */
1004 
1005 struct AppendState;
1006 typedef struct AppendState AppendState;
1007 struct ParallelAppendState;
1009 
1011 {
1012  PlanState ps; /* its first field is NodeTag */
1013  PlanState **appendplans; /* array of PlanStates for my inputs */
1016  ParallelAppendState *as_pstate; /* parallel coordination info */
1017  Size pstate_len; /* size of parallel coordination info */
1018  bool (*choose_next_subplan) (AppendState *);
1019 };
1020 
1021 /* ----------------
1022  * MergeAppendState information
1023  *
1024  * nplans how many plans are in the array
1025  * nkeys number of sort key columns
1026  * sortkeys sort keys in SortSupport representation
1027  * slots current output tuple of each subplan
1028  * heap heap of active tuples
1029  * initialized true if we have fetched first tuple from each subplan
1030  * ----------------
1031  */
1032 typedef struct MergeAppendState
1033 {
1034  PlanState ps; /* its first field is NodeTag */
1035  PlanState **mergeplans; /* array of PlanStates for my inputs */
1038  SortSupport ms_sortkeys; /* array of length ms_nkeys */
1039  TupleTableSlot **ms_slots; /* array of length ms_nplans */
1040  struct binaryheap *ms_heap; /* binary heap of slot indices */
1041  bool ms_initialized; /* are subplans started? */
1043 
1044 /* ----------------
1045  * RecursiveUnionState information
1046  *
1047  * RecursiveUnionState is used for performing a recursive union.
1048  *
1049  * recursing T when we're done scanning the non-recursive term
1050  * intermediate_empty T if intermediate_table is currently empty
1051  * working_table working table (to be scanned by recursive term)
1052  * intermediate_table current recursive output (next generation of WT)
1053  * ----------------
1054  */
1055 typedef struct RecursiveUnionState
1056 {
1057  PlanState ps; /* its first field is NodeTag */
1062  /* Remaining fields are unused in UNION ALL case */
1063  FmgrInfo *eqfunctions; /* per-grouping-field equality fns */
1064  FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
1065  MemoryContext tempContext; /* short-term context for comparisons */
1066  TupleHashTable hashtable; /* hash table for tuples already seen */
1067  MemoryContext tableContext; /* memory context containing hash table */
1069 
1070 /* ----------------
1071  * BitmapAndState information
1072  * ----------------
1073  */
1074 typedef struct BitmapAndState
1075 {
1076  PlanState ps; /* its first field is NodeTag */
1077  PlanState **bitmapplans; /* array of PlanStates for my inputs */
1078  int nplans; /* number of input plans */
1079 } BitmapAndState;
1080 
1081 /* ----------------
1082  * BitmapOrState information
1083  * ----------------
1084  */
1085 typedef struct BitmapOrState
1086 {
1087  PlanState ps; /* its first field is NodeTag */
1088  PlanState **bitmapplans; /* array of PlanStates for my inputs */
1089  int nplans; /* number of input plans */
1090 } BitmapOrState;
1091 
1092 /* ----------------------------------------------------------------
1093  * Scan State Information
1094  * ----------------------------------------------------------------
1095  */
1096 
1097 /* ----------------
1098  * ScanState information
1099  *
1100  * ScanState extends PlanState for node types that represent
1101  * scans of an underlying relation. It can also be used for nodes
1102  * that scan the output of an underlying plan node --- in that case,
1103  * only ScanTupleSlot is actually useful, and it refers to the tuple
1104  * retrieved from the subplan.
1105  *
1106  * currentRelation relation being scanned (NULL if none)
1107  * currentScanDesc current scan descriptor for scan (NULL if none)
1108  * ScanTupleSlot pointer to slot in tuple table holding scan tuple
1109  * ----------------
1110  */
1111 typedef struct ScanState
1112 {
1113  PlanState ps; /* its first field is NodeTag */
1117 } ScanState;
1118 
1119 /* ----------------
1120  * SeqScanState information
1121  * ----------------
1122  */
1123 typedef struct SeqScanState
1124 {
1125  ScanState ss; /* its first field is NodeTag */
1126  Size pscan_len; /* size of parallel heap scan descriptor */
1127 } SeqScanState;
1128 
1129 /* ----------------
1130  * SampleScanState information
1131  * ----------------
1132  */
1133 typedef struct SampleScanState
1134 {
1136  List *args; /* expr states for TABLESAMPLE params */
1137  ExprState *repeatable; /* expr state for REPEATABLE expr */
1138  /* use struct pointer to avoid including tsmapi.h here */
1139  struct TsmRoutine *tsmroutine; /* descriptor for tablesample method */
1140  void *tsm_state; /* tablesample method can keep state here */
1141  bool use_bulkread; /* use bulkread buffer access strategy? */
1142  bool use_pagemode; /* use page-at-a-time visibility checking? */
1143  bool begun; /* false means need to call BeginSampleScan */
1144  uint32 seed; /* random seed */
1145 } SampleScanState;
1146 
1147 /*
1148  * These structs store information about index quals that don't have simple
1149  * constant right-hand sides. See comments for ExecIndexBuildScanKeys()
1150  * for discussion.
1151  */
1152 typedef struct
1153 {
1154  ScanKey scan_key; /* scankey to put value into */
1155  ExprState *key_expr; /* expr to evaluate to get value */
1156  bool key_toastable; /* is expr's result a toastable datatype? */
1158 
1159 typedef struct
1160 {
1161  ScanKey scan_key; /* scankey to put value into */
1162  ExprState *array_expr; /* expr to evaluate to get array value */
1163  int next_elem; /* next array element to use */
1164  int num_elems; /* number of elems in current array value */
1165  Datum *elem_values; /* array of num_elems Datums */
1166  bool *elem_nulls; /* array of num_elems is-null flags */
1168 
1169 /* ----------------
1170  * IndexScanState information
1171  *
1172  * indexqualorig execution state for indexqualorig expressions
1173  * indexorderbyorig execution state for indexorderbyorig expressions
1174  * ScanKeys Skey structures for index quals
1175  * NumScanKeys number of ScanKeys
1176  * OrderByKeys Skey structures for index ordering operators
1177  * NumOrderByKeys number of OrderByKeys
1178  * RuntimeKeys info about Skeys that must be evaluated at runtime
1179  * NumRuntimeKeys number of RuntimeKeys
1180  * RuntimeKeysReady true if runtime Skeys have been computed
1181  * RuntimeContext expr context for evaling runtime Skeys
1182  * RelationDesc index relation descriptor
1183  * ScanDesc index scan descriptor
1184  *
1185  * ReorderQueue tuples that need reordering due to re-check
1186  * ReachedEnd have we fetched all tuples from index already?
1187  * OrderByValues values of ORDER BY exprs of last fetched tuple
1188  * OrderByNulls null flags for OrderByValues
1189  * SortSupport for reordering ORDER BY exprs
1190  * OrderByTypByVals is the datatype of order by expression pass-by-value?
1191  * OrderByTypLens typlens of the datatypes of order by expressions
1192  * pscan_len size of parallel index scan descriptor
1193  * ----------------
1194  */
1195 typedef struct IndexScanState
1196 {
1197  ScanState ss; /* its first field is NodeTag */
1210 
1211  /* These are needed for re-checking ORDER BY expr ordering */
1220 } IndexScanState;
1221 
1222 /* ----------------
1223  * IndexOnlyScanState information
1224  *
1225  * indexqual execution state for indexqual expressions
1226  * ScanKeys Skey structures for index quals
1227  * NumScanKeys number of ScanKeys
1228  * OrderByKeys Skey structures for index ordering operators
1229  * NumOrderByKeys number of OrderByKeys
1230  * RuntimeKeys info about Skeys that must be evaluated at runtime
1231  * NumRuntimeKeys number of RuntimeKeys
1232  * RuntimeKeysReady true if runtime Skeys have been computed
1233  * RuntimeContext expr context for evaling runtime Skeys
1234  * RelationDesc index relation descriptor
1235  * ScanDesc index scan descriptor
1236  * VMBuffer buffer in use for visibility map testing, if any
1237  * HeapFetches number of tuples we were forced to fetch from heap
1238  * ioss_PscanLen Size of parallel index-only scan descriptor
1239  * ----------------
1240  */
1241 typedef struct IndexOnlyScanState
1242 {
1243  ScanState ss; /* its first field is NodeTag */
1259 
1260 /* ----------------
1261  * BitmapIndexScanState information
1262  *
1263  * result bitmap to return output into, or NULL
1264  * ScanKeys Skey structures for index quals
1265  * NumScanKeys number of ScanKeys
1266  * RuntimeKeys info about Skeys that must be evaluated at runtime
1267  * NumRuntimeKeys number of RuntimeKeys
1268  * ArrayKeys info about Skeys that come from ScalarArrayOpExprs
1269  * NumArrayKeys number of ArrayKeys
1270  * RuntimeKeysReady true if runtime Skeys have been computed
1271  * RuntimeContext expr context for evaling runtime Skeys
1272  * RelationDesc index relation descriptor
1273  * ScanDesc index scan descriptor
1274  * ----------------
1275  */
1276 typedef struct BitmapIndexScanState
1277 {
1278  ScanState ss; /* its first field is NodeTag */
1291 
1292 /* ----------------
1293  * SharedBitmapState information
1294  *
1295  * BM_INITIAL TIDBitmap creation is not yet started, so first worker
1296  * to see this state will set the state to BM_INPROGRESS
1297  * and that process will be responsible for creating
1298  * TIDBitmap.
1299  * BM_INPROGRESS TIDBitmap creation is in progress; workers need to
1300  * sleep until it's finished.
1301  * BM_FINISHED TIDBitmap creation is done, so now all workers can
1302  * proceed to iterate over TIDBitmap.
1303  * ----------------
1304  */
1305 typedef enum
1306 {
1311 
1312 /* ----------------
1313  * ParallelBitmapHeapState information
1314  * tbmiterator iterator for scanning current pages
1315  * prefetch_iterator iterator for prefetching ahead of current page
1316  * mutex mutual exclusion for the prefetching variable
1317  * and state
1318  * prefetch_pages # pages prefetch iterator is ahead of current
1319  * prefetch_target current target prefetch distance
1320  * state current state of the TIDBitmap
1321  * cv conditional wait variable
1322  * phs_snapshot_data snapshot data shared to workers
1323  * ----------------
1324  */
1326 {
1334  char phs_snapshot_data[FLEXIBLE_ARRAY_MEMBER];
1336 
1337 /* ----------------
1338  * BitmapHeapScanState information
1339  *
1340  * bitmapqualorig execution state for bitmapqualorig expressions
1341  * tbm bitmap obtained from child index scan(s)
1342  * tbmiterator iterator for scanning current pages
1343  * tbmres current-page data
1344  * can_skip_fetch can we potentially skip tuple fetches in this scan?
1345  * skip_fetch are we skipping tuple fetches on this page?
1346  * vmbuffer buffer for visibility-map lookups
1347  * pvmbuffer ditto, for prefetched pages
1348  * exact_pages total number of exact pages retrieved
1349  * lossy_pages total number of lossy pages retrieved
1350  * prefetch_iterator iterator for prefetching ahead of current page
1351  * prefetch_pages # pages prefetch iterator is ahead of current
1352  * prefetch_target current target prefetch distance
1353  * prefetch_maximum maximum value for prefetch_target
1354  * pscan_len size of the shared memory for parallel bitmap
1355  * initialized is node is ready to iterate
1356  * shared_tbmiterator shared iterator
1357  * shared_prefetch_iterator shared iterator for prefetching
1358  * pstate shared state for parallel bitmap scan
1359  * ----------------
1360  */
1361 typedef struct BitmapHeapScanState
1362 {
1363  ScanState ss; /* its first field is NodeTag */
1384 
1385 /* ----------------
1386  * TidScanState information
1387  *
1388  * tidexprs list of TidExpr structs (see nodeTidscan.c)
1389  * isCurrentOf scan has a CurrentOfExpr qual
1390  * NumTids number of tids in this scan
1391  * TidPtr index of currently fetched tid
1392  * TidList evaluated item pointers (array of size NumTids)
1393  * htup currently-fetched tuple, if any
1394  * ----------------
1395  */
1396 typedef struct TidScanState
1397 {
1398  ScanState ss; /* its first field is NodeTag */
1405 } TidScanState;
1406 
1407 /* ----------------
1408  * SubqueryScanState information
1409  *
1410  * SubqueryScanState is used for scanning a sub-query in the range table.
1411  * ScanTupleSlot references the current output tuple of the sub-query.
1412  * ----------------
1413  */
1414 typedef struct SubqueryScanState
1415 {
1416  ScanState ss; /* its first field is NodeTag */
1419 
1420 /* ----------------
1421  * FunctionScanState information
1422  *
1423  * Function nodes are used to scan the results of a
1424  * function appearing in FROM (typically a function returning set).
1425  *
1426  * eflags node's capability flags
1427  * ordinality is this scan WITH ORDINALITY?
1428  * simple true if we have 1 function and no ordinality
1429  * ordinal current ordinal column value
1430  * nfuncs number of functions being executed
1431  * funcstates per-function execution states (private in
1432  * nodeFunctionscan.c)
1433  * argcontext memory context to evaluate function arguments in
1434  * ----------------
1435  */
1437 
1438 typedef struct FunctionScanState
1439 {
1440  ScanState ss; /* its first field is NodeTag */
1441  int eflags;
1443  bool simple;
1444  int64 ordinal;
1445  int nfuncs;
1446  struct FunctionScanPerFuncState *funcstates; /* array of length nfuncs */
1449 
1450 /* ----------------
1451  * ValuesScanState information
1452  *
1453  * ValuesScan nodes are used to scan the results of a VALUES list
1454  *
1455  * rowcontext per-expression-list context
1456  * exprlists array of expression lists being evaluated
1457  * array_len size of array
1458  * curr_idx current array index (0-based)
1459  *
1460  * Note: ss.ps.ps_ExprContext is used to evaluate any qual or projection
1461  * expressions attached to the node. We create a second ExprContext,
1462  * rowcontext, in which to build the executor expression state for each
1463  * Values sublist. Resetting this context lets us get rid of expression
1464  * state for each row, avoiding major memory leakage over a long values list.
1465  * ----------------
1466  */
1467 typedef struct ValuesScanState
1468 {
1469  ScanState ss; /* its first field is NodeTag */
1474 } ValuesScanState;
1475 
1476 /* ----------------
1477  * TableFuncScanState node
1478  *
1479  * Used in table-expression functions like XMLTABLE.
1480  * ----------------
1481  */
1482 typedef struct TableFuncScanState
1483 {
1484  ScanState ss; /* its first field is NodeTag */
1485  ExprState *docexpr; /* state for document expression */
1486  ExprState *rowexpr; /* state for row-generating expression */
1487  List *colexprs; /* state for column-generating expression */
1488  List *coldefexprs; /* state for column default expressions */
1489  List *ns_names; /* list of str nodes with namespace names */
1490  List *ns_uris; /* list of states of namespace uri exprs */
1491  Bitmapset *notnulls; /* nullability flag for each output column */
1492  void *opaque; /* table builder private space */
1493  const struct TableFuncRoutine *routine; /* table builder methods */
1494  FmgrInfo *in_functions; /* input function for each column */
1495  Oid *typioparams; /* typioparam for each column */
1496  int64 ordinal; /* row number to be output next */
1497  MemoryContext perValueCxt; /* short life context for value evaluation */
1498  Tuplestorestate *tupstore; /* output tuple store */
1500 
1501 /* ----------------
1502  * CteScanState information
1503  *
1504  * CteScan nodes are used to scan a CommonTableExpr query.
1505  *
1506  * Multiple CteScan nodes can read out from the same CTE query. We use
1507  * a tuplestore to hold rows that have been read from the CTE query but
1508  * not yet consumed by all readers.
1509  * ----------------
1510  */
1511 typedef struct CteScanState
1512 {
1513  ScanState ss; /* its first field is NodeTag */
1514  int eflags; /* capability flags to pass to tuplestore */
1515  int readptr; /* index of my tuplestore read pointer */
1516  PlanState *cteplanstate; /* PlanState for the CTE query itself */
1517  /* Link to the "leader" CteScanState (possibly this same node) */
1519  /* The remaining fields are only valid in the "leader" CteScanState */
1520  Tuplestorestate *cte_table; /* rows already read from the CTE query */
1521  bool eof_cte; /* reached end of CTE query? */
1522 } CteScanState;
1523 
1524 /* ----------------
1525  * NamedTuplestoreScanState information
1526  *
1527  * NamedTuplestoreScan nodes are used to scan a Tuplestore created and
1528  * named prior to execution of the query. An example is a transition
1529  * table for an AFTER trigger.
1530  *
1531  * Multiple NamedTuplestoreScan nodes can read out from the same Tuplestore.
1532  * ----------------
1533  */
1535 {
1536  ScanState ss; /* its first field is NodeTag */
1537  int readptr; /* index of my tuplestore read pointer */
1538  TupleDesc tupdesc; /* format of the tuples in the tuplestore */
1539  Tuplestorestate *relation; /* the rows */
1541 
1542 /* ----------------
1543  * WorkTableScanState information
1544  *
1545  * WorkTableScan nodes are used to scan the work table created by
1546  * a RecursiveUnion node. We locate the RecursiveUnion node
1547  * during executor startup.
1548  * ----------------
1549  */
1550 typedef struct WorkTableScanState
1551 {
1552  ScanState ss; /* its first field is NodeTag */
1555 
1556 /* ----------------
1557  * ForeignScanState information
1558  *
1559  * ForeignScan nodes are used to scan foreign-data tables.
1560  * ----------------
1561  */
1562 typedef struct ForeignScanState
1563 {
1564  ScanState ss; /* its first field is NodeTag */
1565  ExprState *fdw_recheck_quals; /* original quals not in ss.ps.qual */
1566  Size pscan_len; /* size of parallel coordination information */
1567  /* use struct pointer to avoid including fdwapi.h here */
1569  void *fdw_state; /* foreign-data wrapper can keep state here */
1571 
1572 /* ----------------
1573  * CustomScanState information
1574  *
1575  * CustomScan nodes are used to execute custom code within executor.
1576  *
1577  * Core code must avoid assuming that the CustomScanState is only as large as
1578  * the structure declared here; providers are allowed to make it the first
1579  * element in a larger structure, and typically would need to do so. The
1580  * struct is actually allocated by the CreateCustomScanState method associated
1581  * with the plan node. Any additional fields can be initialized there, or in
1582  * the BeginCustomScan method.
1583  * ----------------
1584  */
1585 struct CustomExecMethods;
1586 
1587 typedef struct CustomScanState
1588 {
1590  uint32 flags; /* mask of CUSTOMPATH_* flags, see
1591  * nodes/extensible.h */
1592  List *custom_ps; /* list of child PlanState nodes, if any */
1593  Size pscan_len; /* size of parallel coordination information */
1595 } CustomScanState;
1596 
1597 /* ----------------------------------------------------------------
1598  * Join State Information
1599  * ----------------------------------------------------------------
1600  */
1601 
1602 /* ----------------
1603  * JoinState information
1604  *
1605  * Superclass for state nodes of join plans.
1606  * ----------------
1607  */
1608 typedef struct JoinState
1609 {
1612  bool single_match; /* True if we should skip to next outer tuple
1613  * after finding one inner match */
1614  ExprState *joinqual; /* JOIN quals (in addition to ps.qual) */
1615 } JoinState;
1616 
1617 /* ----------------
1618  * NestLoopState information
1619  *
1620  * NeedNewOuter true if need new outer tuple on next call
1621  * MatchedOuter true if found a join match for current outer tuple
1622  * NullInnerTupleSlot prepared null tuple for left outer joins
1623  * ----------------
1624  */
1625 typedef struct NestLoopState
1626 {
1627  JoinState js; /* its first field is NodeTag */
1631 } NestLoopState;
1632 
1633 /* ----------------
1634  * MergeJoinState information
1635  *
1636  * NumClauses number of mergejoinable join clauses
1637  * Clauses info for each mergejoinable clause
1638  * JoinState current state of ExecMergeJoin state machine
1639  * SkipMarkRestore true if we may skip Mark and Restore operations
1640  * ExtraMarks true to issue extra Mark operations on inner scan
1641  * ConstFalseJoin true if we have a constant-false joinqual
1642  * FillOuter true if should emit unjoined outer tuples anyway
1643  * FillInner true if should emit unjoined inner tuples anyway
1644  * MatchedOuter true if found a join match for current outer tuple
1645  * MatchedInner true if found a join match for current inner tuple
1646  * OuterTupleSlot slot in tuple table for cur outer tuple
1647  * InnerTupleSlot slot in tuple table for cur inner tuple
1648  * MarkedTupleSlot slot in tuple table for marked tuple
1649  * NullOuterTupleSlot prepared null tuple for right outer joins
1650  * NullInnerTupleSlot prepared null tuple for left outer joins
1651  * OuterEContext workspace for computing outer tuple's join values
1652  * InnerEContext workspace for computing inner tuple's join values
1653  * ----------------
1654  */
1655 /* private in nodeMergejoin.c: */
1657 
1658 typedef struct MergeJoinState
1659 {
1660  JoinState js; /* its first field is NodeTag */
1662  MergeJoinClause mj_Clauses; /* array of length mj_NumClauses */
1678 } MergeJoinState;
1679 
1680 /* ----------------
1681  * HashJoinState information
1682  *
1683  * hashclauses original form of the hashjoin condition
1684  * hj_OuterHashKeys the outer hash keys in the hashjoin condition
1685  * hj_InnerHashKeys the inner hash keys in the hashjoin condition
1686  * hj_HashOperators the join operators in the hashjoin condition
1687  * hj_HashTable hash table for the hashjoin
1688  * (NULL if table not built yet)
1689  * hj_CurHashValue hash value for current outer tuple
1690  * hj_CurBucketNo regular bucket# for current outer tuple
1691  * hj_CurSkewBucketNo skew bucket# for current outer tuple
1692  * hj_CurTuple last inner tuple matched to current outer
1693  * tuple, or NULL if starting search
1694  * (hj_CurXXX variables are undefined if
1695  * OuterTupleSlot is empty!)
1696  * hj_OuterTupleSlot tuple slot for outer tuples
1697  * hj_HashTupleSlot tuple slot for inner (hashed) tuples
1698  * hj_NullOuterTupleSlot prepared null tuple for right/full outer joins
1699  * hj_NullInnerTupleSlot prepared null tuple for left/full outer joins
1700  * hj_FirstOuterTupleSlot first tuple retrieved from outer plan
1701  * hj_JoinState current state of ExecHashJoin state machine
1702  * hj_MatchedOuter true if found a join match for current outer
1703  * hj_OuterNotEmpty true if outer relation known not empty
1704  * ----------------
1705  */
1706 
1707 /* these structs are defined in executor/hashjoin.h: */
1710 
1711 typedef struct HashJoinState
1712 {
1713  JoinState js; /* its first field is NodeTag */
1715  List *hj_OuterHashKeys; /* list of ExprState nodes */
1716  List *hj_InnerHashKeys; /* list of ExprState nodes */
1717  List *hj_HashOperators; /* list of operator OIDs */
1718  HashJoinTable hj_HashTable;
1722  HashJoinTuple hj_CurTuple;
1731 } HashJoinState;
1732 
1733 
1734 /* ----------------------------------------------------------------
1735  * Materialization State Information
1736  * ----------------------------------------------------------------
1737  */
1738 
1739 /* ----------------
1740  * MaterialState information
1741  *
1742  * materialize nodes are used to materialize the results
1743  * of a subplan into a temporary file.
1744  *
1745  * ss.ss_ScanTupleSlot refers to output of underlying plan.
1746  * ----------------
1747  */
1748 typedef struct MaterialState
1749 {
1750  ScanState ss; /* its first field is NodeTag */
1751  int eflags; /* capability flags to pass to tuplestore */
1752  bool eof_underlying; /* reached end of underlying plan? */
1754 } MaterialState;
1755 
1756 /* ----------------
1757  * Shared memory container for per-worker sort information
1758  * ----------------
1759  */
1760 typedef struct SharedSortInfo
1761 {
1763  TuplesortInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
1764 } SharedSortInfo;
1765 
1766 /* ----------------
1767  * SortState information
1768  * ----------------
1769  */
1770 typedef struct SortState
1771 {
1772  ScanState ss; /* its first field is NodeTag */
1773  bool randomAccess; /* need random access to sort output? */
1774  bool bounded; /* is the result set bounded? */
1775  int64 bound; /* if bounded, how many tuples are needed */
1776  bool sort_Done; /* sort completed yet? */
1777  bool bounded_Done; /* value of bounded we did the sort with */
1778  int64 bound_Done; /* value of bound we did the sort with */
1779  void *tuplesortstate; /* private state of tuplesort.c */
1780  bool am_worker; /* are we a worker? */
1781  SharedSortInfo *shared_info; /* one entry per worker */
1782 } SortState;
1783 
1784 /* ---------------------
1785  * GroupState information
1786  * ---------------------
1787  */
1788 typedef struct GroupState
1789 {
1790  ScanState ss; /* its first field is NodeTag */
1791  FmgrInfo *eqfunctions; /* per-field lookup data for equality fns */
1792  bool grp_done; /* indicates completion of Group scan */
1793 } GroupState;
1794 
1795 /* ---------------------
1796  * AggState information
1797  *
1798  * ss.ss_ScanTupleSlot refers to output of underlying plan.
1799  *
1800  * Note: ss.ps.ps_ExprContext contains ecxt_aggvalues and
1801  * ecxt_aggnulls arrays, which hold the computed agg values for the current
1802  * input group during evaluation of an Agg node's output tuple(s). We
1803  * create a second ExprContext, tmpcontext, in which to evaluate input
1804  * expressions and run the aggregate transition functions.
1805  * ---------------------
1806  */
1807 /* these structs are private in nodeAgg.c: */
1813 
1814 typedef struct AggState
1815 {
1816  ScanState ss; /* its first field is NodeTag */
1817  List *aggs; /* all Aggref nodes in targetlist & quals */
1818  int numaggs; /* length of list (could be zero!) */
1819  int numtrans; /* number of pertrans items */
1820  AggStrategy aggstrategy; /* strategy mode */
1821  AggSplit aggsplit; /* agg-splitting mode, see nodes.h */
1822  AggStatePerPhase phase; /* pointer to current phase data */
1823  int numphases; /* number of phases (including phase 0) */
1824  int current_phase; /* current phase number */
1825  AggStatePerAgg peragg; /* per-Aggref information */
1826  AggStatePerTrans pertrans; /* per-Trans state information */
1827  ExprContext *hashcontext; /* econtexts for long-lived data (hashtable) */
1828  ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */
1829  ExprContext *tmpcontext; /* econtext for input expressions */
1830  ExprContext *curaggcontext; /* currently active aggcontext */
1831  AggStatePerAgg curperagg; /* currently active aggregate, if any */
1832  AggStatePerTrans curpertrans; /* currently active trans state, if any */
1833  bool input_done; /* indicates end of input */
1834  bool agg_done; /* indicates completion of Agg scan */
1835  int projected_set; /* The last projected grouping set */
1836  int current_set; /* The current grouping set being evaluated */
1837  Bitmapset *grouped_cols; /* grouped cols in current projection */
1838  List *all_grouped_cols; /* list of all grouped cols in DESC order */
1839  /* These fields are for grouping set phase data */
1840  int maxsets; /* The max number of sets in any phase */
1841  AggStatePerPhase phases; /* array of all phases */
1842  Tuplesortstate *sort_in; /* sorted input to phases > 1 */
1843  Tuplesortstate *sort_out; /* input is copied here for next phase */
1844  TupleTableSlot *sort_slot; /* slot for sort results */
1845  /* these fields are used in AGG_PLAIN and AGG_SORTED modes: */
1846  AggStatePerGroup pergroup; /* per-Aggref-per-group working state */
1847  HeapTuple grp_firstTuple; /* copy of first tuple of current group */
1848  /* these fields are used in AGG_HASHED and AGG_MIXED modes: */
1849  bool table_filled; /* hash table filled yet? */
1851  AggStatePerHash perhash;
1852  AggStatePerGroup *hash_pergroup; /* array of per-group pointers */
1853  /* support for evaluation of agg input expressions: */
1854  ProjectionInfo *combinedproj; /* projection machinery */
1855 } AggState;
1856 
1857 /* ----------------
1858  * WindowAggState information
1859  * ----------------
1860  */
1861 /* these structs are private in nodeWindowAgg.c: */
1864 
1865 typedef struct WindowAggState
1866 {
1867  ScanState ss; /* its first field is NodeTag */
1868 
1869  /* these fields are filled in by ExecInitExpr: */
1870  List *funcs; /* all WindowFunc nodes in targetlist */
1871  int numfuncs; /* total number of window functions */
1872  int numaggs; /* number that are plain aggregates */
1873 
1874  WindowStatePerFunc perfunc; /* per-window-function information */
1875  WindowStatePerAgg peragg; /* per-plain-aggregate information */
1876  FmgrInfo *partEqfunctions; /* equality funcs for partition columns */
1877  FmgrInfo *ordEqfunctions; /* equality funcs for ordering columns */
1878  Tuplestorestate *buffer; /* stores rows of current partition */
1879  int current_ptr; /* read pointer # for current */
1880  int64 spooled_rows; /* total # of rows in buffer */
1881  int64 currentpos; /* position of current row in partition */
1882  int64 frameheadpos; /* current frame head position */
1883  int64 frametailpos; /* current frame tail position */
1884  /* use struct pointer to avoid including windowapi.h here */
1885  struct WindowObjectData *agg_winobj; /* winobj for aggregate fetches */
1886  int64 aggregatedbase; /* start row for current aggregates */
1887  int64 aggregatedupto; /* rows before this one are aggregated */
1888 
1889  int frameOptions; /* frame_clause options, see WindowDef */
1890  ExprState *startOffset; /* expression for starting bound offset */
1891  ExprState *endOffset; /* expression for ending bound offset */
1892  Datum startOffsetValue; /* result of startOffset evaluation */
1893  Datum endOffsetValue; /* result of endOffset evaluation */
1894 
1895  MemoryContext partcontext; /* context for partition-lifespan data */
1896  MemoryContext aggcontext; /* shared context for aggregate working data */
1897  MemoryContext curaggcontext; /* current aggregate's working data */
1898  ExprContext *tmpcontext; /* short-term evaluation context */
1899 
1900  bool all_first; /* true if the scan is starting */
1901  bool all_done; /* true if the scan is finished */
1902  bool partition_spooled; /* true if all tuples in current partition
1903  * have been spooled into tuplestore */
1904  bool more_partitions; /* true if there's more partitions after
1905  * this one */
1906  bool framehead_valid; /* true if frameheadpos is known up to
1907  * date for current row */
1908  bool frametail_valid; /* true if frametailpos is known up to
1909  * date for current row */
1910 
1911  TupleTableSlot *first_part_slot; /* first tuple of current or next
1912  * partition */
1913 
1914  /* temporary slots for tuples fetched back from tuplestore */
1918 } WindowAggState;
1919 
1920 /* ----------------
1921  * UniqueState information
1922  *
1923  * Unique nodes are used "on top of" sort nodes to discard
1924  * duplicate tuples returned from the sort phase. Basically
1925  * all it does is compare the current tuple from the subplan
1926  * with the previously fetched tuple (stored in its result slot).
1927  * If the two are identical in all interesting fields, then
1928  * we just fetch another tuple from the sort and try again.
1929  * ----------------
1930  */
1931 typedef struct UniqueState
1932 {
1933  PlanState ps; /* its first field is NodeTag */
1934  FmgrInfo *eqfunctions; /* per-field lookup data for equality fns */
1935  MemoryContext tempContext; /* short-term context for comparisons */
1936 } UniqueState;
1937 
1938 /* ----------------
1939  * GatherState information
1940  *
1941  * Gather nodes launch 1 or more parallel workers, run a subplan
1942  * in those workers, and collect the results.
1943  * ----------------
1944  */
1945 typedef struct GatherState
1946 {
1947  PlanState ps; /* its first field is NodeTag */
1948  bool initialized; /* workers launched? */
1949  bool need_to_scan_locally; /* need to read from local plan? */
1950  int64 tuples_needed; /* tuple bound, see ExecSetTupleBound */
1951  /* these fields are set up once: */
1954  /* all remaining fields are reinitialized during a rescan: */
1955  int nworkers_launched; /* original number of workers */
1956  int nreaders; /* number of still-active workers */
1957  int nextreader; /* next one to try to read from */
1958  struct TupleQueueReader **reader; /* array with nreaders active entries */
1959 } GatherState;
1960 
1961 /* ----------------
1962  * GatherMergeState information
1963  *
1964  * Gather merge nodes launch 1 or more parallel workers, run a
1965  * subplan which produces sorted output in each worker, and then
1966  * merge the results into a single sorted stream.
1967  * ----------------
1968  */
1969 struct GMReaderTupleBuffer; /* private in nodeGatherMerge.c */
1970 
1971 typedef struct GatherMergeState
1972 {
1973  PlanState ps; /* its first field is NodeTag */
1974  bool initialized; /* workers launched? */
1975  bool gm_initialized; /* gather_merge_init() done? */
1976  bool need_to_scan_locally; /* need to read from local plan? */
1977  int64 tuples_needed; /* tuple bound, see ExecSetTupleBound */
1978  /* these fields are set up once: */
1979  TupleDesc tupDesc; /* descriptor for subplan result tuples */
1980  int gm_nkeys; /* number of sort columns */
1981  SortSupport gm_sortkeys; /* array of length gm_nkeys */
1983  /* all remaining fields are reinitialized during a rescan */
1984  /* (but the arrays are not reallocated, just cleared) */
1985  int nworkers_launched; /* original number of workers */
1986  int nreaders; /* number of active workers */
1987  TupleTableSlot **gm_slots; /* array with nreaders+1 entries */
1988  struct TupleQueueReader **reader; /* array with nreaders active entries */
1989  struct GMReaderTupleBuffer *gm_tuple_buffers; /* nreaders tuple buffers */
1990  struct binaryheap *gm_heap; /* binary heap of slot indices */
1992 
1993 /* ----------------
1994  * Values displayed by EXPLAIN ANALYZE
1995  * ----------------
1996  */
1997 typedef struct HashInstrumentation
1998 {
1999  int nbuckets; /* number of buckets at end of execution */
2000  int nbuckets_original; /* planned number of buckets */
2001  int nbatch; /* number of batches at end of execution */
2002  int nbatch_original; /* planned number of batches */
2003  size_t space_peak; /* speak memory usage in bytes */
2005 
2006 /* ----------------
2007  * Shared memory container for per-worker hash information
2008  * ----------------
2009  */
2010 typedef struct SharedHashInfo
2011 {
2013  HashInstrumentation hinstrument[FLEXIBLE_ARRAY_MEMBER];
2014 } SharedHashInfo;
2015 
2016 /* ----------------
2017  * HashState information
2018  * ----------------
2019  */
2020 typedef struct HashState
2021 {
2022  PlanState ps; /* its first field is NodeTag */
2023  HashJoinTable hashtable; /* hash table for the hashjoin */
2024  List *hashkeys; /* list of ExprState nodes */
2025  /* hashkeys is same as parent's hj_InnerHashKeys */
2026 
2027  SharedHashInfo *shared_info; /* one entry per worker */
2028  HashInstrumentation *hinstrument; /* this worker's entry */
2029 } HashState;
2030 
2031 /* ----------------
2032  * SetOpState information
2033  *
2034  * Even in "sorted" mode, SetOp nodes are more complex than a simple
2035  * Unique, since we have to count how many duplicates to return. But
2036  * we also support hashing, so this is really more like a cut-down
2037  * form of Agg.
2038  * ----------------
2039  */
2040 /* this struct is private in nodeSetOp.c: */
2042 
2043 typedef struct SetOpState
2044 {
2045  PlanState ps; /* its first field is NodeTag */
2046  FmgrInfo *eqfunctions; /* per-grouping-field equality fns */
2047  FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
2048  bool setop_done; /* indicates completion of output scan */
2049  long numOutput; /* number of dups left to output */
2050  MemoryContext tempContext; /* short-term context for comparisons */
2051  /* these fields are used in SETOP_SORTED mode: */
2052  SetOpStatePerGroup pergroup; /* per-group working state */
2053  HeapTuple grp_firstTuple; /* copy of first tuple of current group */
2054  /* these fields are used in SETOP_HASHED mode: */
2055  TupleHashTable hashtable; /* hash table with one entry per group */
2056  MemoryContext tableContext; /* memory context containing hash table */
2057  bool table_filled; /* hash table filled yet? */
2058  TupleHashIterator hashiter; /* for iterating through hash table */
2059 } SetOpState;
2060 
2061 /* ----------------
2062  * LockRowsState information
2063  *
2064  * LockRows nodes are used to enforce FOR [KEY] UPDATE/SHARE locking.
2065  * ----------------
2066  */
2067 typedef struct LockRowsState
2068 {
2069  PlanState ps; /* its first field is NodeTag */
2070  List *lr_arowMarks; /* List of ExecAuxRowMarks */
2071  EPQState lr_epqstate; /* for evaluating EvalPlanQual rechecks */
2072  HeapTuple *lr_curtuples; /* locked tuples (one entry per RT entry) */
2073  int lr_ntables; /* length of lr_curtuples[] array */
2074 } LockRowsState;
2075 
2076 /* ----------------
2077  * LimitState information
2078  *
2079  * Limit nodes are used to enforce LIMIT/OFFSET clauses.
2080  * They just select the desired subrange of their subplan's output.
2081  *
2082  * offset is the number of initial tuples to skip (0 does nothing).
2083  * count is the number of tuples to return after skipping the offset tuples.
2084  * If no limit count was specified, count is undefined and noCount is true.
2085  * When lstate == LIMIT_INITIAL, offset/count/noCount haven't been set yet.
2086  * ----------------
2087  */
2088 typedef enum
2089 {
2090  LIMIT_INITIAL, /* initial state for LIMIT node */
2091  LIMIT_RESCAN, /* rescan after recomputing parameters */
2092  LIMIT_EMPTY, /* there are no returnable rows */
2093  LIMIT_INWINDOW, /* have returned a row in the window */
2094  LIMIT_SUBPLANEOF, /* at EOF of subplan (within window) */
2095  LIMIT_WINDOWEND, /* stepped off end of window */
2096  LIMIT_WINDOWSTART /* stepped off beginning of window */
2097 } LimitStateCond;
2098 
2099 typedef struct LimitState
2100 {
2101  PlanState ps; /* its first field is NodeTag */
2102  ExprState *limitOffset; /* OFFSET parameter, or NULL if none */
2103  ExprState *limitCount; /* COUNT parameter, or NULL if none */
2104  int64 offset; /* current OFFSET value */
2105  int64 count; /* current COUNT, if any */
2106  bool noCount; /* if true, ignore count */
2107  LimitStateCond lstate; /* state machine status, as above */
2108  int64 position; /* 1-based index of last tuple returned */
2109  TupleTableSlot *subSlot; /* tuple last obtained from subplan */
2110 } LimitState;
2111 
2112 #endif /* EXECNODES_H */
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1251
Datum * elem_values
Definition: execnodes.h:1165
JoinType jointype
Definition: execnodes.h:1611
signed short int16
Definition: c.h:283
struct AggStatePerTransData * AggStatePerTrans
Definition: execnodes.h:1809
FmgrInfo func
Definition: execnodes.h:705
AttrNumber jf_junkAttNo
Definition: execnodes.h:337
int ri_NumIndices
Definition: execnodes.h:358
int slock_t
Definition: s_lock.h:912
AggStatePerGroup * hash_pergroup
Definition: execnodes.h:1852
Size pstate_len
Definition: execnodes.h:1017
struct GroupState GroupState
uint32 CommandId
Definition: c.h:459
HeapTuple * lr_curtuples
Definition: execnodes.h:2072
Node tag
Definition: execnodes.h:56
ScanState ss
Definition: execnodes.h:1564
IndexRuntimeKeyInfo * biss_RuntimeKeys
Definition: execnodes.h:1282
struct TupleHashTableData TupleHashTableData
struct AggStatePerGroupData * AggStatePerGroup
Definition: execnodes.h:1810
JunkFilter * ri_junkFilter
Definition: execnodes.h:397
MemoryContext ii_Context
Definition: execnodes.h:152
Definition: fmgr.h:56
AttrNumber * jf_cleanMap
Definition: execnodes.h:335
MemoryContext curaggcontext
Definition: execnodes.h:1897
HeapTuple * es_epqTuple
Definition: execnodes.h:507
struct TransitionCaptureState * mt_oc_transition_capture
Definition: execnodes.h:991
JunkFilter * es_junkFilter
Definition: execnodes.h:436
struct dsa_area * es_query_dsa
Definition: execnodes.h:514
uint16 * ii_UniqueStrats
Definition: execnodes.h:146
NodeTag type
Definition: execnodes.h:848
bool rs_done
Definition: execnodes.h:934
Relation ri_RelationDesc
Definition: execnodes.h:355
ExprState * endOffset
Definition: execnodes.h:1891
AggStatePerPhase phases
Definition: execnodes.h:1841
struct WindowFuncExprState WindowFuncExprState
struct GMReaderTupleBuffer * gm_tuple_buffers
Definition: execnodes.h:1989
ProjectionInfo * projLeft
Definition: execnodes.h:768
int nworkers_launched
Definition: execnodes.h:1955
HeapTuple curTuple
Definition: execnodes.h:765
ExprState * ri_onConflictSetWhere
Definition: execnodes.h:406
bool nl_MatchedOuter
Definition: execnodes.h:1629
Datum * ecxt_aggvalues
Definition: execnodes.h:214
WorkerInstrumentation * worker_instrument
Definition: execnodes.h:861
struct WindowStatePerAggData * WindowStatePerAgg
Definition: execnodes.h:1863
TupleHashTable hashtable
Definition: execnodes.h:770
ExprState * bitmapqualorig
Definition: execnodes.h:1364
MemoryContext tableContext
Definition: execnodes.h:2056
MemoryContext argcontext
Definition: execnodes.h:952
NodeTag type
Definition: execnodes.h:295
TupleTableSlot * hj_NullInnerTupleSlot
Definition: execnodes.h:1726
Datum startOffsetValue
Definition: execnodes.h:1892
TupleTableSlot ** ms_slots
Definition: execnodes.h:1039
ExprState * aggfilter
Definition: execnodes.h:673
ExprContext * innerecontext
Definition: execnodes.h:776
ExprState * joinqual
Definition: execnodes.h:1614
List * ii_Predicate
Definition: execnodes.h:139
struct ScanState ScanState
CommandId es_output_cid
Definition: execnodes.h:439
ProjectionInfo * ri_onConflictSetProj
Definition: execnodes.h:403
PlanState ps
Definition: execnodes.h:947
Tuplestorestate * tuplestorestate
Definition: execnodes.h:1753
MemoryContext tempContext
Definition: execnodes.h:2050
ProjectionInfo * ps_ProjInfo
Definition: execnodes.h:885
SortSupport ms_sortkeys
Definition: execnodes.h:1038
Instrumentation * instrument
Definition: execnodes.h:860
struct SetOpStatePerGroupData * SetOpStatePerGroup
Definition: execnodes.h:2041
PlanState ps
Definition: execnodes.h:1087
NodeTag type
Definition: execnodes.h:195
ExprContext * mj_InnerEContext
Definition: execnodes.h:1677
bool bounded_Done
Definition: execnodes.h:1777
Tuplestorestate * intermediate_table
Definition: execnodes.h:1061
EPQState lr_epqstate
Definition: execnodes.h:2071
bool mj_ConstFalseJoin
Definition: execnodes.h:1666
int numaggs
Definition: execnodes.h:1818
TupleTableSlot * es_trig_newtup_slot
Definition: execnodes.h:463
Oid es_lastoid
Definition: execnodes.h:479
bool noCount
Definition: execnodes.h:2106
DomainConstraintType constrainttype
Definition: execnodes.h:812
bool agg_done
Definition: execnodes.h:1834
PlanState ps
Definition: execnodes.h:1610
struct WindowAggState WindowAggState
ScanState ss
Definition: execnodes.h:1867
bool nl_NeedNewOuter
Definition: execnodes.h:1628
struct SetExprState SetExprState
TupleTableSlot * inputslot
Definition: execnodes.h:618
Relation relation
Definition: execnodes.h:537
IndexRuntimeKeyInfo * iss_RuntimeKeys
Definition: execnodes.h:1204
bool bounded
Definition: execnodes.h:1774
NodeTag type
Definition: execnodes.h:265
TupleTableSlot * sort_slot
Definition: execnodes.h:1844
List * initPlan
Definition: execnodes.h:871
List * all_grouped_cols
Definition: execnodes.h:1838
ResultRelInfo * resultRelInfo
Definition: execnodes.h:968
Tuplesortstate * sort_out
Definition: execnodes.h:1843
struct ExprEvalStep * steps
Definition: execnodes.h:75
bool shutdown_reg
Definition: execnodes.h:743
ScanState ss
Definition: execnodes.h:1816
int16 * iss_OrderByTypLens
Definition: execnodes.h:1218
bool * innermost_casenull
Definition: execnodes.h:94
FmgrInfo * hashfunctions
Definition: execnodes.h:1064
ExprState * ii_PredicateState
Definition: execnodes.h:140
Relation ri_PartitionRoot
Definition: execnodes.h:415
ExprContext * ps_ExprContext
Definition: execnodes.h:884
MinimalTuple firstTuple
Definition: execnodes.h:592
SortSupport iss_SortSupport
Definition: execnodes.h:1216
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:204
LimitStateCond
Definition: execnodes.h:2088
ExprState * ri_PartitionCheckExpr
Definition: execnodes.h:412
struct BitmapHeapScanState BitmapHeapScanState
tuplehash_iterator TupleHashIterator
Definition: execnodes.h:624
bool single_match
Definition: execnodes.h:1612
HashJoinTable hashtable
Definition: execnodes.h:2023
TIDBitmap * tbm
Definition: execnodes.h:1365
int64 bound
Definition: execnodes.h:1775
bool pending_srf_tuples
Definition: execnodes.h:951
struct TableFuncScanState TableFuncScanState
TupleTableSlot * mt_conflproj
Definition: execnodes.h:979
struct HashInstrumentation HashInstrumentation
Relation biss_RelationDesc
Definition: execnodes.h:1288
List * subPlan
Definition: execnodes.h:873
void * tsm_state
Definition: execnodes.h:1140
TupleTableSlot * mj_MarkedTupleSlot
Definition: execnodes.h:1673
AttrNumber * keyColIdx
Definition: execnodes.h:610
unsigned char uint8
Definition: c.h:294
bool need_to_scan_locally
Definition: execnodes.h:1976
Instrumentation * ri_TrigInstrument
Definition: execnodes.h:376
PlannedStmt * es_plannedstmt
Definition: execnodes.h:433
PlanState ps
Definition: execnodes.h:2045
NodeTag type
Definition: execnodes.h:659
SharedSortInfo * shared_info
Definition: execnodes.h:1781
int current_phase
Definition: execnodes.h:1824
ScanState ss
Definition: execnodes.h:1750
bool need_to_scan_locally
Definition: execnodes.h:1949
Definition: nodes.h:512
AggSplit aggsplit
Definition: execnodes.h:1821
Snapshot es_crosscheck_snapshot
Definition: execnodes.h:431
Oid * ii_ExclusionProcs
Definition: execnodes.h:142
struct CteScanState * leader
Definition: execnodes.h:1518
ScanState ss
Definition: execnodes.h:1513
int64 aggregatedupto
Definition: execnodes.h:1887
List * jf_targetList
Definition: execnodes.h:333
struct ExprState ExprState
TupleTableSlot * mj_NullInnerTupleSlot
Definition: execnodes.h:1675
bool ermActive
Definition: execnodes.h:545
TupleTableSlot * jf_resultSlot
Definition: execnodes.h:336
IndexRuntimeKeyInfo * ioss_RuntimeKeys
Definition: execnodes.h:1249
LockWaitPolicy waitPolicy
Definition: execnodes.h:544
bool hj_MatchedOuter
Definition: execnodes.h:1729
ExprContext * es_per_tuple_exprcontext
Definition: execnodes.h:496
struct NamedTuplestoreScanState NamedTuplestoreScanState
struct SubqueryScanState SubqueryScanState
struct TupleQueueReader ** reader
Definition: execnodes.h:1958
CmdType operation
Definition: execnodes.h:962
ScanState ss
Definition: execnodes.h:1125
Snapshot es_snapshot
Definition: execnodes.h:430
ResultRelInfo * rootResultRelInfo
Definition: execnodes.h:969
bool frametail_valid
Definition: execnodes.h:1908
TupleTableSlot ** gm_slots
Definition: execnodes.h:1987
HeapTuple grp_firstTuple
Definition: execnodes.h:2053
List * args
Definition: execnodes.h:691
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1116
bool am_worker
Definition: execnodes.h:1780
FunctionCallInfoData fcinfo_data
Definition: execnodes.h:750
struct AggStatePerPhaseData * AggStatePerPhase
Definition: execnodes.h:1811
struct WindowStatePerFuncData * WindowStatePerFunc
Definition: execnodes.h:1862
ExprState * testexpr
Definition: execnodes.h:763
FmgrInfo * partEqfunctions
Definition: execnodes.h:1876
MemoryContext argcontext
Definition: execnodes.h:1447
PlanState ** bitmapplans
Definition: execnodes.h:1077
Datum * innermost_domainval
Definition: execnodes.h:96
LockClauseStrength strength
Definition: execnodes.h:543
DomainConstraintType
Definition: execnodes.h:803
Relation ss_currentRelation
Definition: execnodes.h:1114
AggStatePerTrans pertrans
Definition: execnodes.h:1826
EState * state
Definition: execnodes.h:852
TupleTableSlot * hj_OuterTupleSlot
Definition: execnodes.h:1723
int projected_set
Definition: execnodes.h:1835
List * custom_ps
Definition: execnodes.h:1592
LimitStateCond lstate
Definition: execnodes.h:2107
TupleTableSlot * resultslot
Definition: execnodes.h:70
List * es_range_table
Definition: execnodes.h:432
ExprState * fdw_recheck_quals
Definition: execnodes.h:1565
struct PlanState * righttree
Definition: execnodes.h:870
unsigned int Oid
Definition: postgres_ext.h:31
Datum domainValue_datum
Definition: execnodes.h:222
NodeTag
Definition: nodes.h:26
List * hj_OuterHashKeys
Definition: execnodes.h:1715
struct ExecRowMark ExecRowMark
HeapTuple grp_firstTuple
Definition: execnodes.h:1847
ExprState * limitCount
Definition: execnodes.h:2103
TupleTableSlot * temp_slot_1
Definition: execnodes.h:1916
int current_set
Definition: execnodes.h:1836
WindowStatePerFunc perfunc
Definition: execnodes.h:1874
TupleTableSlot * hj_FirstOuterTupleSlot
Definition: execnodes.h:1727
Oid * ii_UniqueOps
Definition: execnodes.h:144
Datum(* ExprStateEvalFunc)(struct ExprState *expression, struct ExprContext *econtext, bool *isNull)
Definition: execnodes.h:46
bool grp_done
Definition: execnodes.h:1792
ExprState * indexqualorig
Definition: execnodes.h:1198
int64 position
Definition: execnodes.h:2108
SharedBitmapState
Definition: execnodes.h:1305
int numtrans
Definition: execnodes.h:1819
ScanKey iss_ScanKeys
Definition: execnodes.h:1200
Size pscan_len
Definition: execnodes.h:1126
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:837
struct ModifyTableState ModifyTableState
PlanState * planstate
Definition: execnodes.h:918
ScanDirection es_direction
Definition: execnodes.h:429
List * indexorderbyorig
Definition: execnodes.h:1199
bool * innermost_domainnull
Definition: execnodes.h:97
PlanState ps
Definition: execnodes.h:1973
uint64 dsa_pointer
Definition: dsa.h:62
Index ri_RangeTableIndex
Definition: execnodes.h:352
ExprContext * tmpcontext
Definition: execnodes.h:1829
int64 count
Definition: execnodes.h:2105
char bool
Definition: c.h:247
PlanState ps
Definition: execnodes.h:1012
JoinType
Definition: nodes.h:676
struct PlanState * lefttree
Definition: execnodes.h:869
HeapTupleData tss_htup
Definition: execnodes.h:1404
struct HashJoinState HashJoinState
TupleTableSlot * first_part_slot
Definition: execnodes.h:1911
TupleTableSlot * mt_existing
Definition: execnodes.h:977
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:611
ScanState ss
Definition: execnodes.h:1469
ExecRowMark * rowmark
Definition: execnodes.h:564
ItemPointerData curCtid
Definition: execnodes.h:546
bool es_use_parallel_mode
Definition: execnodes.h:511
SharedHashInfo * shared_info
Definition: execnodes.h:2027
const struct CustomExecMethods * methods
Definition: execnodes.h:1594
struct SharedSortInfo SharedSortInfo
List * ri_WithCheckOptionExprs
Definition: execnodes.h:391
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:778
bool * iss_OrderByNulls
Definition: execnodes.h:1215
ScanState ss
Definition: execnodes.h:1790
MemoryContext perValueCxt
Definition: execnodes.h:1497
ExprContext * tmpcontext
Definition: execnodes.h:1898
PlanState ps
Definition: execnodes.h:1113
ScanKey ioss_ScanKeys
Definition: execnodes.h:1245
struct WindowObjectData * agg_winobj
Definition: execnodes.h:1885
void * tuplesortstate
Definition: execnodes.h:1779
OnConflictAction mt_onconflict
Definition: execnodes.h:974
int64 frameheadpos
Definition: execnodes.h:1882
int maxsets
Definition: execnodes.h:1840
uint32 hj_CurHashValue
Definition: execnodes.h:1719
Tuplestorestate * funcResultStore
Definition: execnodes.h:712
const char * es_sourceText
Definition: execnodes.h:434
TupleDesc expectedDesc
Definition: execnodes.h:268
int hj_CurSkewBucketNo
Definition: execnodes.h:1721
List * ii_ExpressionsState
Definition: execnodes.h:138
struct ProjectSetState ProjectSetState
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:883
ParamExecData * es_param_exec_vals
Definition: execnodes.h:467
unsigned short uint16
Definition: c.h:295
MemoryContext es_query_cxt
Definition: execnodes.h:472
struct ParallelExecutorInfo * pei
Definition: execnodes.h:1982
struct FunctionScanState FunctionScanState
bool mj_MatchedOuter
Definition: execnodes.h:1669
PlanState ps
Definition: execnodes.h:1076
bool table_filled
Definition: execnodes.h:1849
AggStrategy aggstrategy
Definition: execnodes.h:1820
FmgrInfo * in_hash_funcs
Definition: execnodes.h:619
NodeTag type
Definition: execnodes.h:349
PlanState ps
Definition: execnodes.h:961
int64 offset
Definition: execnodes.h:2104
bool initialized
Definition: execnodes.h:1948
Bitmapset * notnulls
Definition: execnodes.h:1491
struct PlanState * planstate
Definition: execnodes.h:761
TupleTableSlot * hj_NullOuterTupleSlot
Definition: execnodes.h:1725
bool resnull
Definition: execnodes.h:64
ScanState ss
Definition: execnodes.h:1398
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1382
struct CustomScanState CustomScanState
struct ResultRelInfo ResultRelInfo
Expr * expr
Definition: execnodes.h:84
List * args
Definition: execnodes.h:764
SubPlan * subplan
Definition: execnodes.h:760
ParallelAppendState * as_pstate
Definition: execnodes.h:1016
struct ParallelExecutorInfo * pei
Definition: execnodes.h:1953
Datum caseValue_datum
Definition: execnodes.h:218
PlanState ** bitmapplans
Definition: execnodes.h:1088
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:229
List * tss_tidexprs
Definition: execnodes.h:1399
NodeTag type
Definition: execnodes.h:332
AlternativeSubPlan * subplan
Definition: execnodes.h:791
struct SeqScanState SeqScanState
bool iss_ReachedEnd
Definition: execnodes.h:1213
struct TupleHashEntryData TupleHashEntryData
List * arowMarks
Definition: execnodes.h:921
struct HashJoinTupleData * HashJoinTuple
Definition: execnodes.h:1708
ExprState * resconstantqual
Definition: execnodes.h:933
bool mj_MatchedInner
Definition: execnodes.h:1670
bool ri_usesFdwDirectModify
Definition: execnodes.h:385
ScanState ss
Definition: execnodes.h:1589
Tuplesortstate * sort_in
Definition: execnodes.h:1842
AttrNumber * keyColIdx
Definition: execnodes.h:777
MemoryContext tempContext
Definition: execnodes.h:1065
ItemPointerData * tss_TidList
Definition: execnodes.h:1403
NodeTag type
Definition: execnodes.h:689
ExprState ** ri_TrigWhenExprs
Definition: execnodes.h:373
TupleTableSlot * temp_slot_2
Definition: execnodes.h:1917
PlanState ps
Definition: execnodes.h:2069
ExprState * key_expr
Definition: execnodes.h:1155
bool funcReturnsSet
Definition: execnodes.h:726
Aggref * aggref
Definition: execnodes.h:660
struct BitmapAndState BitmapAndState
Datum endOffsetValue
Definition: execnodes.h:1893
Index rti
Definition: execnodes.h:539
WindowStatePerAgg peragg
Definition: execnodes.h:1875
struct TransitionCaptureState * mt_transition_capture
Definition: execnodes.h:989
ExprContext * ioss_RuntimeContext
Definition: execnodes.h:1252
ExprStateEvalFunc evalfunc
Definition: execnodes.h:81
struct MergeJoinClauseData * MergeJoinClause
Definition: execnodes.h:1656
struct EPQState EPQState
void * ermExtra
Definition: execnodes.h:547
Node ** elems
Definition: execnodes.h:948
const struct TableFuncRoutine * routine
Definition: execnodes.h:1493
int iss_NumRuntimeKeys
Definition: execnodes.h:1205
struct MergeJoinState MergeJoinState
ExprState * startOffset
Definition: execnodes.h:1890
MemoryContext tablecxt
Definition: execnodes.h:613
struct ExecAuxRowMark ExecAuxRowMark
TupleDesc jf_cleanTupType
Definition: execnodes.h:334
AttrNumber wholeAttNo
Definition: execnodes.h:567
HashJoinTuple hj_CurTuple
Definition: execnodes.h:1722
Oid * ii_UniqueProcs
Definition: execnodes.h:145
PlanState ps
Definition: execnodes.h:1933
bool table_filled
Definition: execnodes.h:2057
ResultRelInfo * es_result_relations
Definition: execnodes.h:442
int64 aggregatedbase
Definition: execnodes.h:1886
Index prti
Definition: execnodes.h:540
struct ExprContext ExprContext
IndexScanDesc ioss_ScanDesc
Definition: execnodes.h:1254
ExprState * docexpr
Definition: execnodes.h:1485
ScanDirection
Definition: sdir.h:22
EPQState mt_epqstate
Definition: execnodes.h:972
bool * iss_OrderByTypByVals
Definition: execnodes.h:1217
struct TupleHashTableData * TupleHashTable
Definition: execnodes.h:588
long numOutput
Definition: execnodes.h:2049
bool tss_isCurrentOf
Definition: execnodes.h:1400
PlanState ** mergeplans
Definition: execnodes.h:1035
struct ValuesScanState ValuesScanState
struct AggStatePerHashData * AggStatePerHash
Definition: execnodes.h:1812
TupleTableSlot * ecxt_innertuple
Definition: execnodes.h:199
TupleTableSlot * es_trig_oldtup_slot
Definition: execnodes.h:462
bool havenullrows
Definition: execnodes.h:773
ParamExecData * ecxt_param_exec_vals
Definition: execnodes.h:207
ExprState * limitOffset
Definition: execnodes.h:2102
ExprState * check_exprstate
Definition: execnodes.h:815
struct MaterialState MaterialState
struct EState * ecxt_estate
Definition: execnodes.h:226
struct ProjectionInfo ProjectionInfo
List * hashkeys
Definition: execnodes.h:2024
struct HashState HashState
ResultRelInfo ** mt_partitions
Definition: execnodes.h:985
ProjectionInfo * ri_projectReturning
Definition: execnodes.h:400
bool eof_underlying
Definition: execnodes.h:1752
struct FdwRoutine * ri_FdwRoutine
Definition: execnodes.h:379
bool ii_BrokenHotChain
Definition: execnodes.h:150
unsigned int uint32
Definition: c.h:296
PlanState ps
Definition: execnodes.h:2022
int64 bound_Done
Definition: execnodes.h:1778
struct FdwRoutine * fdwroutine
Definition: execnodes.h:1568
AggStatePerAgg curperagg
Definition: execnodes.h:1831
struct PlanState * parent
Definition: execnodes.h:762
struct binaryheap * gm_heap
Definition: execnodes.h:1990
AggStatePerHash perhash
Definition: execnodes.h:1851
ScanState ss
Definition: execnodes.h:1772
PlanState ps
Definition: execnodes.h:1947
FmgrInfo * eqfunctions
Definition: execnodes.h:1063
MergeJoinClause mj_Clauses
Definition: execnodes.h:1662
dsa_pointer tbmiterator
Definition: execnodes.h:1327
Tuplestorestate * buffer
Definition: execnodes.h:1878
int es_instrument
Definition: execnodes.h:482
struct GatherMergeState GatherMergeState
MemoryContext aggcontext
Definition: execnodes.h:1896
ExprState * repeatable
Definition: execnodes.h:1137
Datum * innermost_caseval
Definition: execnodes.h:93
bool iss_RuntimeKeysReady
Definition: execnodes.h:1206
TupleTableSlot * es_trig_tuple_slot
Definition: execnodes.h:461
TupleHashTable hashtable
Definition: execnodes.h:1066
PlanState * subplan
Definition: execnodes.h:1417
List * es_leaf_result_relations
Definition: execnodes.h:457
TupleTableSlot * origslot
Definition: execnodes.h:919
struct LockRowsState LockRowsState
struct RecursiveUnionState RecursiveUnionState
bool ii_ReadyForInserts
Definition: execnodes.h:148
HashInstrumentation * hinstrument
Definition: execnodes.h:2028
List * hj_HashOperators
Definition: execnodes.h:1717
Bitmapset * grouped_cols
Definition: execnodes.h:1837
struct HashJoinTableData * HashJoinTable
Definition: execnodes.h:1709
ExprState ** ri_ConstraintExprs
Definition: execnodes.h:394
TBMIterateResult * tbmres
Definition: execnodes.h:1367
TriggerDesc * ri_TrigDesc
Definition: execnodes.h:367
struct AggState AggState
ScanKey ioss_OrderByKeys
Definition: execnodes.h:1247
Index rowmarkId
Definition: execnodes.h:541
TupleHashIterator hashiter
Definition: execnodes.h:2058
Bitmapset * chgParam
Definition: execnodes.h:878
struct AggrefExprState AggrefExprState
struct ExprContext_CB * next
Definition: execnodes.h:165
Tuplestorestate * working_table
Definition: execnodes.h:1060
bool rs_checkqual
Definition: execnodes.h:935
void * ii_AmCache
Definition: execnodes.h:151
struct AlternativeSubPlanState AlternativeSubPlanState
QueryEnvironment * es_queryEnv
Definition: execnodes.h:469
int es_num_root_result_relations
Definition: execnodes.h:454
int hj_CurBucketNo
Definition: execnodes.h:1720
RecursiveUnionState * rustate
Definition: execnodes.h:1553
PlanState ** mt_plans
Definition: execnodes.h:965
struct FunctionScanPerFuncState * funcstates
Definition: execnodes.h:1446
int num_hashes
Definition: execnodes.h:1850
SetFunctionReturnMode
Definition: execnodes.h:249
int64 spooled_rows
Definition: execnodes.h:1880
bool domainValue_isNull
Definition: execnodes.h:223
bool input_done
Definition: execnodes.h:1833
ExprDoneCond
Definition: execnodes.h:236
ProjectionInfo * combinedproj
Definition: execnodes.h:1854
ExprContext * curaggcontext
Definition: execnodes.h:1830
ExprContext * hashcontext
Definition: execnodes.h:1827
bool * ecxt_aggnulls
Definition: execnodes.h:215
bool mj_SkipMarkRestore
Definition: execnodes.h:1664
struct NestLoopState NestLoopState
List * es_trig_target_relations
Definition: execnodes.h:460
Plan * plan
Definition: execnodes.h:920
List * es_tupleTable
Definition: execnodes.h:474
LockClauseStrength
Definition: lockoptions.h:21
AggStatePerPhase phase
Definition: execnodes.h:1822
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:856
List * es_auxmodifytables
Definition: execnodes.h:489
Datum curArray
Definition: execnodes.h:766
uintptr_t Datum
Definition: postgres.h:372
TupleDesc tupDesc
Definition: execnodes.h:1979
IndexScanDesc biss_ScanDesc
Definition: execnodes.h:1289
ExecProcNodeMtd ExecProcNodeReal
Definition: execnodes.h:857
ExprContext * rowcontext
Definition: execnodes.h:1470
int ii_NumIndexAttrs
Definition: execnodes.h:135
TupleTableSlot * funnel_slot
Definition: execnodes.h:1952
AggStatePerGroup pergroup
Definition: execnodes.h:1846
List * ri_WithCheckOptions
Definition: execnodes.h:388
TupleTableSlot * mt_partition_tuple_slot
Definition: execnodes.h:988
TupleDesc funcResultDesc
Definition: execnodes.h:719
Expr * expr
Definition: execnodes.h:690
struct TupleHashEntryData * TupleHashEntry
Definition: execnodes.h:587
TupleTableSlot * agg_row_slot
Definition: execnodes.h:1915
int es_num_result_relations
Definition: execnodes.h:443
TIDBitmap * biss_result
Definition: execnodes.h:1279
List * ri_PartitionCheck
Definition: execnodes.h:409
unsigned int Index
Definition: c.h:413
struct TupleQueueReader ** reader
Definition: execnodes.h:1988
FmgrInfo * hashfunctions
Definition: execnodes.h:2047
TupleTableSlot * nl_NullInnerTupleSlot
Definition: execnodes.h:1630
FmgrInfo * eqfunctions
Definition: execnodes.h:1934
Plan * plan
Definition: execnodes.h:850
MemoryContext tempContext
Definition: execnodes.h:1935
MemoryContext hashtempcxt
Definition: execnodes.h:775
bool more_partitions
Definition: execnodes.h:1904
struct SampleScanState SampleScanState
Relation ioss_RelationDesc
Definition: execnodes.h:1253
bool es_finished
Definition: execnodes.h:483
PlanState ps
Definition: execnodes.h:1034
void * ri_FdwState
Definition: execnodes.h:382
ExprState * array_expr
Definition: execnodes.h:1162
int allowedModes
Definition: execnodes.h:269
struct EState EState
JoinState js
Definition: execnodes.h:1660
MemoryContext hashtablecxt
Definition: execnodes.h:774
dsa_pointer prefetch_iterator
Definition: execnodes.h:1328
struct binaryheap * ms_heap
Definition: execnodes.h:1040
tuplehash_hash * hashtab
Definition: execnodes.h:608
FmgrInfo * ordEqfunctions
Definition: execnodes.h:1877
ScanState ss
Definition: execnodes.h:1197
bool ii_Unique
Definition: execnodes.h:147
struct PlanState PlanState
SetFunctionReturnMode returnMode
Definition: execnodes.h:271
ExprContext ** aggcontexts
Definition: execnodes.h:1828
MemoryContext tableContext
Definition: execnodes.h:1067
TupleTableSlot * ecxt_outertuple
Definition: execnodes.h:200
bool hj_OuterNotEmpty
Definition: execnodes.h:1730
int64 frametailpos
Definition: execnodes.h:1883
List * ii_Expressions
Definition: execnodes.h:137
NodeTag type
Definition: execnodes.h:134
FmgrInfo * tab_eq_funcs
Definition: execnodes.h:779
TupleTableSlot * tableslot
Definition: execnodes.h:616
TupleTableSlot * mj_InnerTupleSlot
Definition: execnodes.h:1672
struct AggStatePerAggData * AggStatePerAgg
Definition: execnodes.h:1808
bool setop_done
Definition: execnodes.h:2048
struct UniqueState UniqueState
FmgrInfo * in_functions
Definition: execnodes.h:1494
TupleTableSlot * subSlot
Definition: execnodes.h:2109
RowMarkType markType
Definition: execnodes.h:542
uint64 es_processed
Definition: execnodes.h:478
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:161
int as_whichplan
Definition: execnodes.h:1015
#define INDEX_MAX_KEYS
size_t Size
Definition: c.h:404
AggSplit
Definition: nodes.h:760
bool funcReturnsTuple
Definition: execnodes.h:720
ExprContext * mj_OuterEContext
Definition: execnodes.h:1676
struct ParallelBitmapHeapState ParallelBitmapHeapState
bool randomAccess
Definition: execnodes.h:1773
FmgrInfo * eqfunctions
Definition: execnodes.h:2046
RowMarkType
Definition: plannodes.h:964
struct SetOpState SetOpState
SharedBitmapState state
Definition: execnodes.h:1332
bool sort_Done
Definition: execnodes.h:1776
Tuplestorestate * relation
Definition: execnodes.h:1539
ExprState * indexqual
Definition: execnodes.h:1244
TupleTableSlot * ecxt_scantuple
Definition: execnodes.h:198
SetOpStatePerGroup pergroup
Definition: execnodes.h:2052
bool * es_epqTupleSet
Definition: execnodes.h:508
List * es_subplanstates
Definition: execnodes.h:487
struct TsmRoutine * tsmroutine
Definition: execnodes.h:1139
TBMSharedIterator * shared_tbmiterator
Definition: execnodes.h:1380
AttrNumber toidAttNo
Definition: execnodes.h:566
List * es_rowMarks
Definition: execnodes.h:476
ExprContext * iss_RuntimeContext
Definition: execnodes.h:1207
TBMIterator * tbmiterator
Definition: execnodes.h:1366
MemoryContext ecxt_per_query_memory
Definition: execnodes.h:203
TupleTableSlot * mj_NullOuterTupleSlot
Definition: execnodes.h:1674
int numphases
Definition: execnodes.h:1823
struct IndexInfo IndexInfo
bool ii_Concurrent
Definition: execnodes.h:149
FmgrInfo * lhs_hash_funcs
Definition: execnodes.h:780
int64 currentpos
Definition: execnodes.h:1881
ExprState * qual
Definition: execnodes.h:868
Tuplestorestate * setResult
Definition: execnodes.h:274
FmgrInfo * cur_eq_funcs
Definition: execnodes.h:781
TupleConversionMap ** mt_transition_tupconv_maps
Definition: execnodes.h:993
List * mt_arbiterindexes
Definition: execnodes.h:975
bool setArgsValid
Definition: execnodes.h:735
HeapScanDesc ss_currentScanDesc
Definition: execnodes.h:1115
PlanState * cteplanstate
Definition: execnodes.h:1516
ExprContext * econtext
Definition: execnodes.h:267
struct MergeAppendState MergeAppendState
JoinState js
Definition: execnodes.h:1627
IndexArrayKeyInfo * biss_ArrayKeys
Definition: execnodes.h:1284
List * mt_excludedtlist
Definition: execnodes.h:978
int nextreader
Definition: execnodes.h:1957
TupleTableSlot * funcResultSlot
Definition: execnodes.h:713
TupleTableSlot * hj_HashTupleSlot
Definition: execnodes.h:1724
List * hj_InnerHashKeys
Definition: execnodes.h:1716
Definition: dsa.c:354
bool caseValue_isNull
Definition: execnodes.h:219
bool partition_spooled
Definition: execnodes.h:1902
Oid * ii_ExclusionOps
Definition: execnodes.h:141
AggStrategy
Definition: nodes.h:738
struct TidScanState TidScanState
TupleDesc setDesc
Definition: execnodes.h:275
ConditionVariable cv
Definition: execnodes.h:1333
ExprState * elidedFuncState
Definition: execnodes.h:698
struct ReturnSetInfo ReturnSetInfo
int steps_alloc
Definition: execnodes.h:91
struct GatherState GatherState
HashJoinTable hj_HashTable
Definition: execnodes.h:1718
int es_top_eflags
Definition: execnodes.h:481
FmgrInfo * eqfunctions
Definition: execnodes.h:1791
AggStatePerAgg peragg
Definition: execnodes.h:1825
bool framehead_valid
Definition: execnodes.h:1906
int steps_len
Definition: execnodes.h:90
PlanState ** appendplans
Definition: execnodes.h:1013
TBMIterator * prefetch_iterator
Definition: execnodes.h:1374
ResultRelInfo * es_root_result_relations
Definition: execnodes.h:453
struct DomainConstraintState DomainConstraintState
IndexInfo ** ri_IndexRelationInfo
Definition: execnodes.h:364
struct PartitionDispatchData ** mt_partition_dispatch_info
Definition: execnodes.h:980
List * lr_arowMarks
Definition: execnodes.h:2070
struct ExprContext_CB ExprContext_CB
NodeTag type
Definition: execnodes.h:759
bool * es_epqScanDone
Definition: execnodes.h:509
struct JunkFilter JunkFilter
ExprDoneCond * elemdone
Definition: execnodes.h:949
uint8 flags
Definition: execnodes.h:58
NodeTag type
Definition: execnodes.h:426
ExprState pi_state
Definition: execnodes.h:297
void * arg
AggStatePerTrans curpertrans
Definition: execnodes.h:1832
int epqParam
Definition: execnodes.h:922
ParamListInfo es_param_list_info
Definition: execnodes.h:466
FmgrInfo * cur_eq_funcs
Definition: execnodes.h:620
List * es_exprcontexts
Definition: execnodes.h:485
MemoryContext tempcxt
Definition: execnodes.h:614
ProjectionInfo * projRight
Definition: execnodes.h:769
MemoryContext partcontext
Definition: execnodes.h:1895
struct CteScanState CteScanState
TupleConversionMap ** mt_partition_tupconv_maps
Definition: execnodes.h:986
ExprDoneCond isDone
Definition: execnodes.h:272
struct ResultState ResultState
WindowFunc * wfunc
Definition: execnodes.h:671
List * aggs
Definition: execnodes.h:1817
ExprContext * biss_RuntimeContext
Definition: execnodes.h:1287
bool mj_ExtraMarks
Definition: execnodes.h:1665
EState * estate
Definition: execnodes.h:917
Datum * iss_OrderByValues
Definition: execnodes.h:1214
uint16 * ii_ExclusionStrats
Definition: execnodes.h:143
struct BitmapIndexScanState BitmapIndexScanState
ParamListInfo ecxt_param_list_info
Definition: execnodes.h:208
int iss_NumOrderByKeys
Definition: execnodes.h:1203
Tuplestorestate * cte_table
Definition: execnodes.h:1520
List ** exprlists
Definition: execnodes.h:1471
ExprContext * pi_exprContext
Definition: execnodes.h:299
IndexScanDesc iss_ScanDesc
Definition: execnodes.h:1209
struct SortState SortState
Definition: pg_list.h:45
Tuplestorestate * tupstore
Definition: execnodes.h:1498
int Buffer
Definition: buf.h:23
OnConflictAction
Definition: nodes.h:802
bool havehashrows
Definition: execnodes.h:772
Datum resvalue
Definition: execnodes.h:65
int16 AttrNumber
Definition: attnum.h:21
ExprState * rowexpr
Definition: execnodes.h:1486
JoinState js
Definition: execnodes.h:1713
struct IndexOnlyScanState IndexOnlyScanState
LockWaitPolicy
Definition: lockoptions.h:36
CmdType
Definition: nodes.h:652
TupleHashTable hashnulls
Definition: execnodes.h:771
AttrNumber ctidAttNo
Definition: execnodes.h:565
RelationPtr ri_IndexRelationDescs
Definition: execnodes.h:361
PlanState ps
Definition: execnodes.h:2101
struct SubPlanState SubPlanState
TBMSharedIterator * shared_prefetch_iterator
Definition: execnodes.h:1381
struct IndexScanState IndexScanState
TupleHashTable hashtable
Definition: execnodes.h:2055
ExprState * hashclauses
Definition: execnodes.h:1714
FmgrInfo * ri_TrigFunctions
Definition: execnodes.h:370
struct ForeignScanState ForeignScanState
struct BitmapOrState BitmapOrState
Relation iss_RelationDesc
Definition: execnodes.h:1208
List ** mt_arowmarks
Definition: execnodes.h:971
TupleTableSlot * mj_OuterTupleSlot
Definition: execnodes.h:1671
SortSupport gm_sortkeys
Definition: execnodes.h:1981
pairingheap * iss_ReorderQueue
Definition: execnodes.h:1212
FmgrInfo * tab_eq_funcs
Definition: execnodes.h:612
struct SharedHashInfo SharedHashInfo
struct LimitState LimitState
int64 tuples_needed
Definition: execnodes.h:1950
struct WorkTableScanState WorkTableScanState
struct JoinState JoinState
PlanState ps
Definition: execnodes.h:932
ScanState ss
Definition: execnodes.h:1135
ScanKey iss_OrderByKeys
Definition: execnodes.h:1202
ResultRelInfo * es_result_relation_info
Definition: execnodes.h:444