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-2021, 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/tupconvert.h"
18 #include "executor/instrument.h"
19 #include "fmgr.h"
20 #include "lib/pairingheap.h"
21 #include "nodes/params.h"
22 #include "nodes/plannodes.h"
23 #include "nodes/tidbitmap.h"
24 #include "partitioning/partdefs.h"
26 #include "utils/hsearch.h"
27 #include "utils/queryenvironment.h"
28 #include "utils/reltrigger.h"
29 #include "utils/sharedtuplestore.h"
30 #include "utils/snapshot.h"
31 #include "utils/sortsupport.h"
32 #include "utils/tuplesort.h"
33 #include "utils/tuplestore.h"
34 
35 struct PlanState; /* forward references in this file */
37 struct ExecRowMark;
38 struct ExprState;
39 struct ExprContext;
40 struct RangeTblEntry; /* avoid including parsenodes.h here */
41 struct ExprEvalStep; /* avoid including execExpr.h everywhere */
43 
44 
45 /* ----------------
46  * ExprState node
47  *
48  * ExprState is the top-level node for expression evaluation.
49  * It contains instructions (in ->steps) to evaluate the expression.
50  * ----------------
51  */
52 typedef Datum (*ExprStateEvalFunc) (struct ExprState *expression,
53  struct ExprContext *econtext,
54  bool *isNull);
55 
56 /* Bits in ExprState->flags (see also execExpr.h for private flag bits): */
57 /* expression is for use with ExecQual() */
58 #define EEO_FLAG_IS_QUAL (1 << 0)
59 
60 typedef struct ExprState
61 {
63 
64  uint8 flags; /* bitmask of EEO_FLAG_* bits, see above */
65 
66  /*
67  * Storage for result value of a scalar expression, or for individual
68  * column results within expressions built by ExecBuildProjectionInfo().
69  */
70 #define FIELDNO_EXPRSTATE_RESNULL 2
71  bool resnull;
72 #define FIELDNO_EXPRSTATE_RESVALUE 3
74 
75  /*
76  * If projecting a tuple result, this slot holds the result; else NULL.
77  */
78 #define FIELDNO_EXPRSTATE_RESULTSLOT 4
80 
81  /*
82  * Instructions to compute expression's return value.
83  */
85 
86  /*
87  * Function that actually evaluates the expression. This can be set to
88  * different values depending on the complexity of the expression.
89  */
91 
92  /* original expression tree, for debugging only */
94 
95  /* private state for an evalfunc */
97 
98  /*
99  * XXX: following fields only needed during "compilation" (ExecInitExpr);
100  * could be thrown away afterwards.
101  */
102 
103  int steps_len; /* number of steps currently */
104  int steps_alloc; /* allocated length of steps array */
105 
106 #define FIELDNO_EXPRSTATE_PARENT 11
107  struct PlanState *parent; /* parent PlanState node, if any */
108  ParamListInfo ext_params; /* for compiling PARAM_EXTERN nodes */
109 
112 
115 } ExprState;
116 
117 
118 /* ----------------
119  * IndexInfo information
120  *
121  * this struct holds the information needed to construct new index
122  * entries for a particular index. Used for both index_build and
123  * retail creation of index entries.
124  *
125  * NumIndexAttrs total number of columns in this index
126  * NumIndexKeyAttrs number of key columns in index
127  * IndexAttrNumbers underlying-rel attribute numbers used as keys
128  * (zeroes indicate expressions). It also contains
129  * info about included columns.
130  * Expressions expr trees for expression entries, or NIL if none
131  * ExpressionsState exec state for expressions, or NIL if none
132  * Predicate partial-index predicate, or NIL if none
133  * PredicateState exec state for predicate, or NIL if none
134  * ExclusionOps Per-column exclusion operators, or NULL if none
135  * ExclusionProcs Underlying function OIDs for ExclusionOps
136  * ExclusionStrats Opclass strategy numbers for ExclusionOps
137  * UniqueOps These are like Exclusion*, but for unique indexes
138  * UniqueProcs
139  * UniqueStrats
140  * Unique is it a unique index?
141  * OpclassOptions opclass-specific options, or NULL if none
142  * ReadyForInserts is it valid for inserts?
143  * Concurrent are we doing a concurrent index build?
144  * BrokenHotChain did we detect any broken HOT chains?
145  * ParallelWorkers # of workers requested (excludes leader)
146  * Am Oid of index AM
147  * AmCache private cache area for index AM
148  * Context memory context holding this IndexInfo
149  *
150  * ii_Concurrent, ii_BrokenHotChain, and ii_ParallelWorkers are used only
151  * during index build; they're conventionally zeroed otherwise.
152  * ----------------
153  */
154 typedef struct IndexInfo
155 {
157  int ii_NumIndexAttrs; /* total number of columns in index */
158  int ii_NumIndexKeyAttrs; /* number of key columns in index */
159  AttrNumber ii_IndexAttrNumbers[INDEX_MAX_KEYS];
160  List *ii_Expressions; /* list of Expr */
161  List *ii_ExpressionsState; /* list of ExprState */
162  List *ii_Predicate; /* list of Expr */
164  Oid *ii_ExclusionOps; /* array with one entry per column */
165  Oid *ii_ExclusionProcs; /* array with one entry per column */
166  uint16 *ii_ExclusionStrats; /* array with one entry per column */
167  Oid *ii_UniqueOps; /* array with one entry per column */
168  Oid *ii_UniqueProcs; /* array with one entry per column */
169  uint16 *ii_UniqueStrats; /* array with one entry per column */
170  Datum *ii_OpclassOptions; /* array with one entry per column */
171  bool ii_Unique;
177  void *ii_AmCache;
179 } IndexInfo;
180 
181 /* ----------------
182  * ExprContext_CB
183  *
184  * List of callbacks to be called at ExprContext shutdown.
185  * ----------------
186  */
188 
189 typedef struct ExprContext_CB
190 {
195 
196 /* ----------------
197  * ExprContext
198  *
199  * This class holds the "current context" information
200  * needed to evaluate expressions for doing tuple qualifications
201  * and tuple projections. For example, if an expression refers
202  * to an attribute in the current inner tuple then we need to know
203  * what the current inner tuple is and so we look at the expression
204  * context.
205  *
206  * There are two memory contexts associated with an ExprContext:
207  * * ecxt_per_query_memory is a query-lifespan context, typically the same
208  * context the ExprContext node itself is allocated in. This context
209  * can be used for purposes such as storing function call cache info.
210  * * ecxt_per_tuple_memory is a short-term context for expression results.
211  * As the name suggests, it will typically be reset once per tuple,
212  * before we begin to evaluate expressions for that tuple. Each
213  * ExprContext normally has its very own per-tuple memory context.
214  *
215  * CurrentMemoryContext should be set to ecxt_per_tuple_memory before
216  * calling ExecEvalExpr() --- see ExecEvalExprSwitchContext().
217  * ----------------
218  */
219 typedef struct ExprContext
220 {
222 
223  /* Tuples that Var nodes in expression may refer to */
224 #define FIELDNO_EXPRCONTEXT_SCANTUPLE 1
226 #define FIELDNO_EXPRCONTEXT_INNERTUPLE 2
228 #define FIELDNO_EXPRCONTEXT_OUTERTUPLE 3
230 
231  /* Memory contexts for expression evaluation --- see notes above */
234 
235  /* Values to substitute for Param nodes in expression */
236  ParamExecData *ecxt_param_exec_vals; /* for PARAM_EXEC params */
237  ParamListInfo ecxt_param_list_info; /* for other param types */
238 
239  /*
240  * Values to substitute for Aggref nodes in the expressions of an Agg
241  * node, or for WindowFunc nodes within a WindowAgg node.
242  */
243 #define FIELDNO_EXPRCONTEXT_AGGVALUES 8
244  Datum *ecxt_aggvalues; /* precomputed values for aggs/windowfuncs */
245 #define FIELDNO_EXPRCONTEXT_AGGNULLS 9
246  bool *ecxt_aggnulls; /* null flags for aggs/windowfuncs */
247 
248  /* Value to substitute for CaseTestExpr nodes in expression */
249 #define FIELDNO_EXPRCONTEXT_CASEDATUM 10
251 #define FIELDNO_EXPRCONTEXT_CASENULL 11
253 
254  /* Value to substitute for CoerceToDomainValue nodes in expression */
255 #define FIELDNO_EXPRCONTEXT_DOMAINDATUM 12
257 #define FIELDNO_EXPRCONTEXT_DOMAINNULL 13
259 
260  /* Link to containing EState (NULL if a standalone ExprContext) */
262 
263  /* Functions to call back when ExprContext is shut down or rescanned */
265 } ExprContext;
266 
267 /*
268  * Set-result status used when evaluating functions potentially returning a
269  * set.
270  */
271 typedef enum
272 {
273  ExprSingleResult, /* expression does not return a set */
274  ExprMultipleResult, /* this result is an element of a set */
275  ExprEndResult /* there are no more elements in the set */
276 } ExprDoneCond;
277 
278 /*
279  * Return modes for functions returning sets. Note values must be chosen
280  * as separate bits so that a bitmask can be formed to indicate supported
281  * modes. SFRM_Materialize_Random and SFRM_Materialize_Preferred are
282  * auxiliary flags about SFRM_Materialize mode, rather than separate modes.
283  */
284 typedef enum
285 {
286  SFRM_ValuePerCall = 0x01, /* one value returned per call */
287  SFRM_Materialize = 0x02, /* result set instantiated in Tuplestore */
288  SFRM_Materialize_Random = 0x04, /* Tuplestore needs randomAccess */
289  SFRM_Materialize_Preferred = 0x08 /* caller prefers Tuplestore */
291 
292 /*
293  * When calling a function that might return a set (multiple rows),
294  * a node of this type is passed as fcinfo->resultinfo to allow
295  * return status to be passed back. A function returning set should
296  * raise an error if no such resultinfo is provided.
297  */
298 typedef struct ReturnSetInfo
299 {
301  /* values set by caller: */
302  ExprContext *econtext; /* context function is being called in */
303  TupleDesc expectedDesc; /* tuple descriptor expected by caller */
304  int allowedModes; /* bitmask: return modes caller can handle */
305  /* result status from function (but pre-initialized by caller): */
306  SetFunctionReturnMode returnMode; /* actual return mode */
307  ExprDoneCond isDone; /* status for ValuePerCall mode */
308  /* fields filled by function in Materialize return mode: */
309  Tuplestorestate *setResult; /* holds the complete returned tuple set */
310  TupleDesc setDesc; /* actual descriptor for returned tuples */
311 } ReturnSetInfo;
312 
313 /* ----------------
314  * ProjectionInfo node information
315  *
316  * This is all the information needed to perform projections ---
317  * that is, form new tuples by evaluation of targetlist expressions.
318  * Nodes which need to do projections create one of these.
319  *
320  * The target tuple slot is kept in ProjectionInfo->pi_state.resultslot.
321  * ExecProject() evaluates the tlist, forms a tuple, and stores it
322  * in the given slot. Note that the result will be a "virtual" tuple
323  * unless ExecMaterializeSlot() is then called to force it to be
324  * converted to a physical tuple. The slot must have a tupledesc
325  * that matches the output of the tlist!
326  * ----------------
327  */
328 typedef struct ProjectionInfo
329 {
331  /* instructions to evaluate projection */
333  /* expression context in which to evaluate expression */
336 
337 /* ----------------
338  * JunkFilter
339  *
340  * This class is used to store information regarding junk attributes.
341  * A junk attribute is an attribute in a tuple that is needed only for
342  * storing intermediate information in the executor, and does not belong
343  * in emitted tuples. For example, when we do an UPDATE query,
344  * the planner adds a "junk" entry to the targetlist so that the tuples
345  * returned to ExecutePlan() contain an extra attribute: the ctid of
346  * the tuple to be updated. This is needed to do the update, but we
347  * don't want the ctid to be part of the stored new tuple! So, we
348  * apply a "junk filter" to remove the junk attributes and form the
349  * real output tuple. The junkfilter code also provides routines to
350  * extract the values of the junk attribute(s) from the input tuple.
351  *
352  * targetList: the original target list (including junk attributes).
353  * cleanTupType: the tuple descriptor for the "clean" tuple (with
354  * junk attributes removed).
355  * cleanMap: A map with the correspondence between the non-junk
356  * attribute numbers of the "original" tuple and the
357  * attribute numbers of the "clean" tuple.
358  * resultSlot: tuple slot used to hold cleaned tuple.
359  * junkAttNo: not used by junkfilter code. Can be used by caller
360  * to remember the attno of a specific junk attribute
361  * (nodeModifyTable.c keeps the "ctid" or "wholerow"
362  * attno here).
363  * ----------------
364  */
365 typedef struct JunkFilter
366 {
373 } JunkFilter;
374 
375 /*
376  * OnConflictSetState
377  *
378  * Executor state of an ON CONFLICT DO UPDATE operation.
379  */
380 typedef struct OnConflictSetState
381 {
383 
384  TupleTableSlot *oc_Existing; /* slot to store existing target tuple in */
385  TupleTableSlot *oc_ProjSlot; /* CONFLICT ... SET ... projection target */
386  ProjectionInfo *oc_ProjInfo; /* for ON CONFLICT DO UPDATE SET */
387  ExprState *oc_WhereClause; /* state for the WHERE clause */
389 
390 /*
391  * ResultRelInfo
392  *
393  * Whenever we update an existing relation, we have to update indexes on the
394  * relation, and perhaps also fire triggers. ResultRelInfo holds all the
395  * information needed about a result relation, including indexes.
396  *
397  * Normally, a ResultRelInfo refers to a table that is in the query's range
398  * table; then ri_RangeTableIndex is the RT index and ri_RelationDesc is
399  * just a copy of the relevant es_relations[] entry. However, in some
400  * situations we create ResultRelInfos for relations that are not in the
401  * range table, namely for targets of tuple routing in a partitioned table,
402  * and when firing triggers in tables other than the target tables (See
403  * ExecGetTriggerResultRel). In these situations, ri_RangeTableIndex is 0
404  * and ri_RelationDesc is a separately-opened relcache pointer that needs to
405  * be separately closed.
406  */
407 typedef struct ResultRelInfo
408 {
410 
411  /* result relation's range table index, or 0 if not in range table */
413 
414  /* relation descriptor for result relation */
416 
417  /* # of indices existing on result relation */
419 
420  /* array of relation descriptors for indices */
422 
423  /* array of key/attr info for indices */
425 
426  /* triggers to be fired, if any */
428 
429  /* cached lookup info for trigger functions */
431 
432  /* array of trigger WHEN expr states */
434 
435  /* optional runtime measurements for triggers */
437 
438  /* On-demand created slots for triggers / returning processing */
439  TupleTableSlot *ri_ReturningSlot; /* for trigger output tuples */
440  TupleTableSlot *ri_TrigOldSlot; /* for a trigger's old tuple */
441  TupleTableSlot *ri_TrigNewSlot; /* for a trigger's new tuple */
442 
443  /* FDW callback functions, if foreign table */
445 
446  /* available to save private state of FDW */
447  void *ri_FdwState;
448 
449  /* true when modifying foreign table directly */
451 
452  /* batch insert stuff */
453  int ri_NumSlots; /* number of slots in the array */
454  int ri_BatchSize; /* max slots inserted in a single batch */
455  TupleTableSlot **ri_Slots; /* input tuples for batch insert */
457 
458  /* list of WithCheckOption's to be checked */
460 
461  /* list of WithCheckOption expr states */
463 
464  /* array of constraint-checking expr states */
466 
467  /* array of stored generated columns expr states */
469 
470  /* number of stored generated columns we need to compute */
472 
473  /* for removing junk attributes from tuples */
475 
476  /* list of RETURNING expressions */
478 
479  /* for computing a RETURNING list */
481 
482  /* list of arbiter indexes to use to check conflicts */
484 
485  /* ON CONFLICT evaluation state */
487 
488  /* partition check expression state (NULL if not set up yet) */
490 
491  /*
492  * Information needed by tuple routing target relations
493  *
494  * RootResultRelInfo gives the target relation mentioned in the query, if
495  * it's a partitioned table. It is not set if the target relation
496  * mentioned in the query is an inherited table, nor when tuple routing is
497  * not needed.
498  *
499  * RootToPartitionMap and PartitionTupleSlot, initialized by
500  * ExecInitRoutingInfo, are non-NULL if partition has a different tuple
501  * format than the root table.
502  */
506 
507  /*
508  * Map to convert child result relation tuples to the format of the table
509  * actually mentioned in the query (called "root"). Set only if
510  * transition tuple capture or update partition row movement is active.
511  */
513 
514  /* for use by copyfrom.c when performing multi-inserts */
516 } ResultRelInfo;
517 
518 /* ----------------
519  * EState information
520  *
521  * Working state for an Executor invocation
522  * ----------------
523  */
524 typedef struct EState
525 {
527 
528  /* Basic state for all query types: */
529  ScanDirection es_direction; /* current scan direction */
530  Snapshot es_snapshot; /* time qual to use */
531  Snapshot es_crosscheck_snapshot; /* crosscheck time qual for RI */
532  List *es_range_table; /* List of RangeTblEntry */
533  Index es_range_table_size; /* size of the range table arrays */
534  Relation *es_relations; /* Array of per-range-table-entry Relation
535  * pointers, or NULL if not yet opened */
536  struct ExecRowMark **es_rowmarks; /* Array of per-range-table-entry
537  * ExecRowMarks, or NULL if none */
538  PlannedStmt *es_plannedstmt; /* link to top of plan tree */
539  const char *es_sourceText; /* Source text from QueryDesc */
540 
541  JunkFilter *es_junkFilter; /* top-level junk filter, if any */
542 
543  /* If query can insert/delete tuples, the command ID to mark them with */
545 
546  /* Info about target table(s) for insert/update/delete queries: */
547  ResultRelInfo **es_result_relations; /* Array of per-range-table-entry
548  * ResultRelInfo pointers, or NULL
549  * if not a target table */
550  List *es_opened_result_relations; /* List of non-NULL entries in
551  * es_result_relations in no
552  * specific order */
553 
554  PartitionDirectory es_partition_directory; /* for PartitionDesc lookup */
555 
556  /*
557  * The following list contains ResultRelInfos created by the tuple routing
558  * code for partitions that aren't found in the es_result_relations array.
559  */
561 
562  /* Stuff used for firing triggers: */
563  List *es_trig_target_relations; /* trigger-only ResultRelInfos */
564 
565  /* Parameter info: */
566  ParamListInfo es_param_list_info; /* values of external params */
567  ParamExecData *es_param_exec_vals; /* values of internal params */
568 
569  QueryEnvironment *es_queryEnv; /* query environment */
570 
571  /* Other working state: */
572  MemoryContext es_query_cxt; /* per-query context in which EState lives */
573 
574  List *es_tupleTable; /* List of TupleTableSlots */
575 
576  uint64 es_processed; /* # of tuples processed */
577 
578  int es_top_eflags; /* eflags passed to ExecutorStart */
579  int es_instrument; /* OR of InstrumentOption flags */
580  bool es_finished; /* true when ExecutorFinish is done */
581 
582  List *es_exprcontexts; /* List of ExprContexts within EState */
583 
584  List *es_subplanstates; /* List of PlanState for SubPlans */
585 
586  List *es_auxmodifytables; /* List of secondary ModifyTableStates */
587 
588  /*
589  * this ExprContext is for per-output-tuple operations, such as constraint
590  * checks and index-value computations. It will be reset for each output
591  * tuple. Note that it will be created only if needed.
592  */
594 
595  /*
596  * If not NULL, this is an EPQState's EState. This is a field in EState
597  * both to allow EvalPlanQual aware executor nodes to detect that they
598  * need to perform EPQ related work, and to provide necessary information
599  * to do so.
600  */
602 
603  bool es_use_parallel_mode; /* can we use parallel workers? */
604 
605  /* The per-query shared memory area to use for parallel execution. */
607 
608  /*
609  * JIT information. es_jit_flags indicates whether JIT should be performed
610  * and with which options. es_jit is created on-demand when JITing is
611  * performed.
612  *
613  * es_jit_worker_instr is the combined, on demand allocated,
614  * instrumentation from all workers. The leader's instrumentation is kept
615  * separate, and is combined on demand by ExplainPrintJITSummary().
616  */
620 } EState;
621 
622 
623 /*
624  * ExecRowMark -
625  * runtime representation of FOR [KEY] UPDATE/SHARE clauses
626  *
627  * When doing UPDATE, DELETE, or SELECT FOR [KEY] UPDATE/SHARE, we will have an
628  * ExecRowMark for each non-target relation in the query (except inheritance
629  * parent RTEs, which can be ignored at runtime). Virtual relations such as
630  * subqueries-in-FROM will have an ExecRowMark with relation == NULL. See
631  * PlanRowMark for details about most of the fields. In addition to fields
632  * directly derived from PlanRowMark, we store an activity flag (to denote
633  * inactive children of inheritance trees), curCtid, which is used by the
634  * WHERE CURRENT OF code, and ermExtra, which is available for use by the plan
635  * node that sources the relation (e.g., for a foreign table the FDW can use
636  * ermExtra to hold information).
637  *
638  * EState->es_rowmarks is an array of these structs, indexed by RT index,
639  * with NULLs for irrelevant RT indexes. es_rowmarks itself is NULL if
640  * there are no rowmarks.
641  */
642 typedef struct ExecRowMark
643 {
644  Relation relation; /* opened and suitably locked relation */
645  Oid relid; /* its OID (or InvalidOid, if subquery) */
646  Index rti; /* its range table index */
647  Index prti; /* parent range table index, if child */
648  Index rowmarkId; /* unique identifier for resjunk columns */
649  RowMarkType markType; /* see enum in nodes/plannodes.h */
650  LockClauseStrength strength; /* LockingClause's strength, or LCS_NONE */
651  LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED */
652  bool ermActive; /* is this mark relevant for current tuple? */
653  ItemPointerData curCtid; /* ctid of currently locked tuple, if any */
654  void *ermExtra; /* available for use by relation source node */
655 } ExecRowMark;
656 
657 /*
658  * ExecAuxRowMark -
659  * additional runtime representation of FOR [KEY] UPDATE/SHARE clauses
660  *
661  * Each LockRows and ModifyTable node keeps a list of the rowmarks it needs to
662  * deal with. In addition to a pointer to the related entry in es_rowmarks,
663  * this struct carries the column number(s) of the resjunk columns associated
664  * with the rowmark (see comments for PlanRowMark for more detail). In the
665  * case of ModifyTable, there has to be a separate ExecAuxRowMark list for
666  * each child plan, because the resjunk columns could be at different physical
667  * column positions in different subplans.
668  */
669 typedef struct ExecAuxRowMark
670 {
671  ExecRowMark *rowmark; /* related entry in es_rowmarks */
672  AttrNumber ctidAttNo; /* resno of ctid junk attribute, if any */
673  AttrNumber toidAttNo; /* resno of tableoid junk attribute, if any */
674  AttrNumber wholeAttNo; /* resno of whole-row junk attribute, if any */
676 
677 
678 /* ----------------------------------------------------------------
679  * Tuple Hash Tables
680  *
681  * All-in-memory tuple hash tables are used for a number of purposes.
682  *
683  * Note: tab_hash_funcs are for the key datatype(s) stored in the table,
684  * and tab_eq_funcs are non-cross-type equality operators for those types.
685  * Normally these are the only functions used, but FindTupleHashEntry()
686  * supports searching a hashtable using cross-data-type hashing. For that,
687  * the caller must supply hash functions for the LHS datatype as well as
688  * the cross-type equality operators to use. in_hash_funcs and cur_eq_func
689  * are set to point to the caller's function arrays while doing such a search.
690  * During LookupTupleHashEntry(), they point to tab_hash_funcs and
691  * tab_eq_func respectively.
692  * ----------------------------------------------------------------
693  */
696 
697 typedef struct TupleHashEntryData
698 {
699  MinimalTuple firstTuple; /* copy of first tuple in this group */
700  void *additional; /* user data */
701  uint32 status; /* hash status */
702  uint32 hash; /* hash value (cached) */
704 
705 /* define parameters necessary to generate the tuple hash table interface */
706 #define SH_PREFIX tuplehash
707 #define SH_ELEMENT_TYPE TupleHashEntryData
708 #define SH_KEY_TYPE MinimalTuple
709 #define SH_SCOPE extern
710 #define SH_DECLARE
711 #include "lib/simplehash.h"
712 
713 typedef struct TupleHashTableData
714 {
715  tuplehash_hash *hashtab; /* underlying hash table */
716  int numCols; /* number of columns in lookup key */
717  AttrNumber *keyColIdx; /* attr numbers of key columns */
718  FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */
719  ExprState *tab_eq_func; /* comparator for table datatype(s) */
720  Oid *tab_collations; /* collations for hash and comparison */
721  MemoryContext tablecxt; /* memory context containing table */
722  MemoryContext tempcxt; /* context for function evaluations */
723  Size entrysize; /* actual size to make each hash entry */
724  TupleTableSlot *tableslot; /* slot for referencing table entries */
725  /* The following fields are set transiently for each table search: */
726  TupleTableSlot *inputslot; /* current input tuple's slot */
727  FmgrInfo *in_hash_funcs; /* hash functions for input datatype(s) */
728  ExprState *cur_eq_func; /* comparator for input vs. table */
729  uint32 hash_iv; /* hash-function IV */
730  ExprContext *exprcontext; /* expression context */
732 
733 typedef tuplehash_iterator TupleHashIterator;
734 
735 /*
736  * Use InitTupleHashIterator/TermTupleHashIterator for a read/write scan.
737  * Use ResetTupleHashIterator if the table can be frozen (in this case no
738  * explicit scan termination is needed).
739  */
740 #define InitTupleHashIterator(htable, iter) \
741  tuplehash_start_iterate(htable->hashtab, iter)
742 #define TermTupleHashIterator(iter) \
743  ((void) 0)
744 #define ResetTupleHashIterator(htable, iter) \
745  InitTupleHashIterator(htable, iter)
746 #define ScanTupleHashTable(htable, iter) \
747  tuplehash_iterate(htable->hashtab, iter)
748 
749 
750 /* ----------------------------------------------------------------
751  * Expression State Nodes
752  *
753  * Formerly, there was a separate executor expression state node corresponding
754  * to each node in a planned expression tree. That's no longer the case; for
755  * common expression node types, all the execution info is embedded into
756  * step(s) in a single ExprState node. But we still have a few executor state
757  * node types for selected expression node types, mostly those in which info
758  * has to be shared with other parts of the execution state tree.
759  * ----------------------------------------------------------------
760  */
761 
762 /* ----------------
763  * WindowFuncExprState node
764  * ----------------
765  */
766 typedef struct WindowFuncExprState
767 {
769  WindowFunc *wfunc; /* expression plan node */
770  List *args; /* ExprStates for argument expressions */
771  ExprState *aggfilter; /* FILTER expression */
772  int wfuncno; /* ID number for wfunc within its plan node */
774 
775 
776 /* ----------------
777  * SetExprState node
778  *
779  * State for evaluating a potentially set-returning expression (like FuncExpr
780  * or OpExpr). In some cases, like some of the expressions in ROWS FROM(...)
781  * the expression might not be a SRF, but nonetheless it uses the same
782  * machinery as SRFs; it will be treated as a SRF returning a single row.
783  * ----------------
784  */
785 typedef struct SetExprState
786 {
788  Expr *expr; /* expression plan node */
789  List *args; /* ExprStates for argument expressions */
790 
791  /*
792  * In ROWS FROM, functions can be inlined, removing the FuncExpr normally
793  * inside. In such a case this is the compiled expression (which cannot
794  * return a set), which'll be evaluated using regular ExecEvalExpr().
795  */
797 
798  /*
799  * Function manager's lookup info for the target function. If func.fn_oid
800  * is InvalidOid, we haven't initialized it yet (nor any of the following
801  * fields, except funcReturnsSet).
802  */
804 
805  /*
806  * For a set-returning function (SRF) that returns a tuplestore, we keep
807  * the tuplestore here and dole out the result rows one at a time. The
808  * slot holds the row currently being returned.
809  */
812 
813  /*
814  * In some cases we need to compute a tuple descriptor for the function's
815  * output. If so, it's stored here.
816  */
818  bool funcReturnsTuple; /* valid when funcResultDesc isn't NULL */
819 
820  /*
821  * Remember whether the function is declared to return a set. This is set
822  * by ExecInitExpr, and is valid even before the FmgrInfo is set up.
823  */
825 
826  /*
827  * setArgsValid is true when we are evaluating a set-returning function
828  * that uses value-per-call mode and we are in the middle of a call
829  * series; we want to pass the same argument values to the function again
830  * (and again, until it returns ExprEndResult). This indicates that
831  * fcinfo_data already contains valid argument data.
832  */
834 
835  /*
836  * Flag to remember whether we have registered a shutdown callback for
837  * this SetExprState. We do so only if funcResultStore or setArgsValid
838  * has been set at least once (since all the callback is for is to release
839  * the tuplestore or clear setArgsValid).
840  */
841  bool shutdown_reg; /* a shutdown callback is registered */
842 
843  /*
844  * Call parameter structure for the function. This has been initialized
845  * (by InitFunctionCallInfoData) if func.fn_oid is valid. It also saves
846  * argument values between calls, when setArgsValid is true.
847  */
849 } SetExprState;
850 
851 /* ----------------
852  * SubPlanState node
853  * ----------------
854  */
855 typedef struct SubPlanState
856 {
858  SubPlan *subplan; /* expression plan node */
859  struct PlanState *planstate; /* subselect plan's state tree */
860  struct PlanState *parent; /* parent plan node's state tree */
861  ExprState *testexpr; /* state of combining expression */
862  List *args; /* states of argument expression(s) */
863  HeapTuple curTuple; /* copy of most recent tuple from subplan */
864  Datum curArray; /* most recent array from ARRAY() subplan */
865  /* these are used when hashing the subselect's output: */
866  TupleDesc descRight; /* subselect desc after projection */
867  ProjectionInfo *projLeft; /* for projecting lefthand exprs */
868  ProjectionInfo *projRight; /* for projecting subselect output */
869  TupleHashTable hashtable; /* hash table for no-nulls subselect rows */
870  TupleHashTable hashnulls; /* hash table for rows with null(s) */
871  bool havehashrows; /* true if hashtable is not empty */
872  bool havenullrows; /* true if hashnulls is not empty */
873  MemoryContext hashtablecxt; /* memory context containing hash tables */
874  MemoryContext hashtempcxt; /* temp memory context for hash tables */
875  ExprContext *innerecontext; /* econtext for computing inner tuples */
876  int numCols; /* number of columns being hashed */
877  /* each of the remaining fields is an array of length numCols: */
878  AttrNumber *keyColIdx; /* control data for hash tables */
879  Oid *tab_eq_funcoids; /* equality func oids for table
880  * datatype(s) */
881  Oid *tab_collations; /* collations for hash and comparison */
882  FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */
883  FmgrInfo *tab_eq_funcs; /* equality functions for table datatype(s) */
884  FmgrInfo *lhs_hash_funcs; /* hash functions for lefthand datatype(s) */
885  FmgrInfo *cur_eq_funcs; /* equality functions for LHS vs. table */
886  ExprState *cur_eq_comp; /* equality comparator for LHS vs. table */
887 } SubPlanState;
888 
889 /*
890  * DomainConstraintState - one item to check during CoerceToDomain
891  *
892  * Note: we consider this to be part of an ExprState tree, so we give it
893  * a name following the xxxState convention. But there's no directly
894  * associated plan-tree node.
895  */
897 {
901 
902 typedef struct DomainConstraintState
903 {
905  DomainConstraintType constrainttype; /* constraint type */
906  char *name; /* name of constraint (for error msgs) */
907  Expr *check_expr; /* for CHECK, a boolean expression */
908  ExprState *check_exprstate; /* check_expr's eval state, or NULL */
910 
911 
912 /* ----------------------------------------------------------------
913  * Executor State Trees
914  *
915  * An executing query has a PlanState tree paralleling the Plan tree
916  * that describes the plan.
917  * ----------------------------------------------------------------
918  */
919 
920 /* ----------------
921  * ExecProcNodeMtd
922  *
923  * This is the method called by ExecProcNode to return the next tuple
924  * from an executor node. It returns NULL, or an empty TupleTableSlot,
925  * if no more tuples are available.
926  * ----------------
927  */
928 typedef TupleTableSlot *(*ExecProcNodeMtd) (struct PlanState *pstate);
929 
930 /* ----------------
931  * PlanState node
932  *
933  * We never actually instantiate any PlanState nodes; this is just the common
934  * abstract superclass for all PlanState-type nodes.
935  * ----------------
936  */
937 typedef struct PlanState
938 {
940 
941  Plan *plan; /* associated Plan node */
942 
943  EState *state; /* at execution time, states of individual
944  * nodes point to one EState for the whole
945  * top-level plan */
946 
947  ExecProcNodeMtd ExecProcNode; /* function to return next tuple */
948  ExecProcNodeMtd ExecProcNodeReal; /* actual function, if above is a
949  * wrapper */
950 
951  Instrumentation *instrument; /* Optional runtime stats for this node */
952  WorkerInstrumentation *worker_instrument; /* per-worker instrumentation */
953 
954  /* Per-worker JIT instrumentation */
956 
957  /*
958  * Common structural data for all Plan types. These links to subsidiary
959  * state trees parallel links in the associated plan tree (except for the
960  * subPlan list, which does not exist in the plan tree).
961  */
962  ExprState *qual; /* boolean qual condition */
963  struct PlanState *lefttree; /* input plan tree(s) */
965 
966  List *initPlan; /* Init SubPlanState nodes (un-correlated expr
967  * subselects) */
968  List *subPlan; /* SubPlanState nodes in my expressions */
969 
970  /*
971  * State for management of parameter-change-driven rescanning
972  */
973  Bitmapset *chgParam; /* set of IDs of changed Params */
974 
975  /*
976  * Other run-time state needed by most if not all node types.
977  */
978  TupleDesc ps_ResultTupleDesc; /* node's return type */
979  TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */
980  ExprContext *ps_ExprContext; /* node's expression-evaluation context */
981  ProjectionInfo *ps_ProjInfo; /* info for doing tuple projection */
982 
983  /*
984  * Scanslot's descriptor if known. This is a bit of a hack, but otherwise
985  * it's hard for expression compilation to optimize based on the
986  * descriptor, without encoding knowledge about all executor nodes.
987  */
989 
990  /*
991  * Define the slot types for inner, outer and scanslots for expression
992  * contexts with this state as a parent. If *opsset is set, then
993  * *opsfixed indicates whether *ops is guaranteed to be the type of slot
994  * used. That means that every slot in the corresponding
995  * ExprContext.ecxt_*tuple will point to a slot of that type, while
996  * evaluating the expression. If *opsfixed is false, but *ops is set,
997  * that indicates the most likely type of slot.
998  *
999  * The scan* fields are set by ExecInitScanTupleSlot(). If that's not
1000  * called, nodes can initialize the fields themselves.
1001  *
1002  * If outer/inneropsset is false, the information is inferred on-demand
1003  * using ExecGetResultSlotOps() on ->righttree/lefttree, using the
1004  * corresponding node's resultops* fields.
1005  *
1006  * The result* fields are automatically set when ExecInitResultSlot is
1007  * used (be it directly or when the slot is created by
1008  * ExecAssignScanProjectionInfo() /
1009  * ExecConditionalAssignProjectionInfo()). If no projection is necessary
1010  * ExecConditionalAssignProjectionInfo() defaults those fields to the scan
1011  * operations.
1012  */
1025 } PlanState;
1026 
1027 /* ----------------
1028  * these are defined to avoid confusion problems with "left"
1029  * and "right" and "inner" and "outer". The convention is that
1030  * the "left" plan is the "outer" plan and the "right" plan is
1031  * the inner plan, but these make the code more readable.
1032  * ----------------
1033  */
1034 #define innerPlanState(node) (((PlanState *)(node))->righttree)
1035 #define outerPlanState(node) (((PlanState *)(node))->lefttree)
1036 
1037 /* Macros for inline access to certain instrumentation counters */
1038 #define InstrCountTuples2(node, delta) \
1039  do { \
1040  if (((PlanState *)(node))->instrument) \
1041  ((PlanState *)(node))->instrument->ntuples2 += (delta); \
1042  } while (0)
1043 #define InstrCountFiltered1(node, delta) \
1044  do { \
1045  if (((PlanState *)(node))->instrument) \
1046  ((PlanState *)(node))->instrument->nfiltered1 += (delta); \
1047  } while(0)
1048 #define InstrCountFiltered2(node, delta) \
1049  do { \
1050  if (((PlanState *)(node))->instrument) \
1051  ((PlanState *)(node))->instrument->nfiltered2 += (delta); \
1052  } while(0)
1053 
1054 /*
1055  * EPQState is state for executing an EvalPlanQual recheck on a candidate
1056  * tuples e.g. in ModifyTable or LockRows.
1057  *
1058  * To execute EPQ a separate EState is created (stored in ->recheckestate),
1059  * which shares some resources, like the rangetable, with the main query's
1060  * EState (stored in ->parentestate). The (sub-)tree of the plan that needs to
1061  * be rechecked (in ->plan), is separately initialized (into
1062  * ->recheckplanstate), but shares plan nodes with the corresponding nodes in
1063  * the main query. The scan nodes in that separate executor tree are changed
1064  * to return only the current tuple of interest for the respective
1065  * table. Those tuples are either provided by the caller (using
1066  * EvalPlanQualSlot), and/or found using the rowmark mechanism (non-locking
1067  * rowmarks by the EPQ machinery itself, locking ones by the caller).
1068  *
1069  * While the plan to be checked may be changed using EvalPlanQualSetPlan() -
1070  * e.g. so all source plans for a ModifyTable node can be processed - all such
1071  * plans need to share the same EState.
1072  */
1073 typedef struct EPQState
1074 {
1075  /* Initialized at EvalPlanQualInit() time: */
1076 
1077  EState *parentestate; /* main query's EState */
1078  int epqParam; /* ID of Param to force scan node re-eval */
1079 
1080  /*
1081  * Tuples to be substituted by scan nodes. They need to set up, before
1082  * calling EvalPlanQual()/EvalPlanQualNext(), into the slot returned by
1083  * EvalPlanQualSlot(scanrelid). The array is indexed by scanrelid - 1.
1084  */
1085  List *tuple_table; /* tuple table for relsubs_slot */
1087 
1088  /*
1089  * Initialized by EvalPlanQualInit(), may be changed later with
1090  * EvalPlanQualSetPlan():
1091  */
1092 
1093  Plan *plan; /* plan tree to be executed */
1094  List *arowMarks; /* ExecAuxRowMarks (non-locking only) */
1095 
1096 
1097  /*
1098  * The original output tuple to be rechecked. Set by
1099  * EvalPlanQualSetSlot(), before EvalPlanQualNext() or EvalPlanQual() may
1100  * be called.
1101  */
1103 
1104 
1105  /* Initialized or reset by EvalPlanQualBegin(): */
1106 
1107  EState *recheckestate; /* EState for EPQ execution, see above */
1108 
1109  /*
1110  * Rowmarks that can be fetched on-demand using
1111  * EvalPlanQualFetchRowMark(), indexed by scanrelid - 1. Only non-locking
1112  * rowmarks.
1113  */
1115 
1116  /*
1117  * True if a relation's EPQ tuple has been fetched for relation, indexed
1118  * by scanrelid - 1.
1119  */
1121 
1122  PlanState *recheckplanstate; /* EPQ specific exec nodes, for ->plan */
1123 } EPQState;
1124 
1125 
1126 /* ----------------
1127  * ResultState information
1128  * ----------------
1129  */
1130 typedef struct ResultState
1131 {
1132  PlanState ps; /* its first field is NodeTag */
1134  bool rs_done; /* are we done? */
1135  bool rs_checkqual; /* do we need to check the qual? */
1136 } ResultState;
1137 
1138 /* ----------------
1139  * ProjectSetState information
1140  *
1141  * Note: at least one of the "elems" will be a SetExprState; the rest are
1142  * regular ExprStates.
1143  * ----------------
1144  */
1145 typedef struct ProjectSetState
1146 {
1147  PlanState ps; /* its first field is NodeTag */
1148  Node **elems; /* array of expression states */
1149  ExprDoneCond *elemdone; /* array of per-SRF is-done states */
1150  int nelems; /* length of elemdone[] array */
1151  bool pending_srf_tuples; /* still evaluating srfs in tlist? */
1152  MemoryContext argcontext; /* context for SRF arguments */
1153 } ProjectSetState;
1154 
1155 /* ----------------
1156  * ModifyTableState information
1157  * ----------------
1158  */
1159 typedef struct ModifyTableState
1160 {
1161  PlanState ps; /* its first field is NodeTag */
1162  CmdType operation; /* INSERT, UPDATE, or DELETE */
1163  bool canSetTag; /* do we set the command tag/es_processed? */
1164  bool mt_done; /* are we done? */
1165  PlanState **mt_plans; /* subplans (one per target rel) */
1166  int mt_nplans; /* number of plans in the array */
1167  int mt_whichplan; /* which one is being executed (0..n-1) */
1168  TupleTableSlot **mt_scans; /* input tuple corresponding to underlying
1169  * plans */
1170  ResultRelInfo *resultRelInfo; /* per-subplan target relations */
1171 
1172  /*
1173  * Target relation mentioned in the original statement, used to fire
1174  * statement-level triggers and as the root for tuple routing.
1175  */
1177 
1178  List **mt_arowmarks; /* per-subplan ExecAuxRowMark lists */
1179  EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */
1180  bool fireBSTriggers; /* do we need to fire stmt triggers? */
1181 
1182  /*
1183  * Slot for storing tuples in the root partitioned table's rowtype during
1184  * an UPDATE of a partitioned table.
1185  */
1187 
1188  /* Tuple-routing support info */
1190 
1191  /* controls transition table population for specified operation */
1193 
1194  /* controls transition table population for INSERT...ON CONFLICT UPDATE */
1197 
1198 /* ----------------
1199  * AppendState information
1200  *
1201  * nplans how many plans are in the array
1202  * whichplan which plan is being executed (0 .. n-1), or a
1203  * special negative value. See nodeAppend.c.
1204  * prune_state details required to allow partitions to be
1205  * eliminated from the scan, or NULL if not possible.
1206  * valid_subplans for runtime pruning, valid appendplans indexes to
1207  * scan.
1208  * ----------------
1209  */
1210 
1211 struct AppendState;
1212 typedef struct AppendState AppendState;
1213 struct ParallelAppendState;
1215 struct PartitionPruneState;
1216 
1218 {
1219  PlanState ps; /* its first field is NodeTag */
1220  PlanState **appendplans; /* array of PlanStates for my inputs */
1223  int as_first_partial_plan; /* Index of 'appendplans' containing
1224  * the first partial plan */
1225  ParallelAppendState *as_pstate; /* parallel coordination info */
1226  Size pstate_len; /* size of parallel coordination info */
1229  bool (*choose_next_subplan) (AppendState *);
1230 };
1231 
1232 /* ----------------
1233  * MergeAppendState information
1234  *
1235  * nplans how many plans are in the array
1236  * nkeys number of sort key columns
1237  * sortkeys sort keys in SortSupport representation
1238  * slots current output tuple of each subplan
1239  * heap heap of active tuples
1240  * initialized true if we have fetched first tuple from each subplan
1241  * prune_state details required to allow partitions to be
1242  * eliminated from the scan, or NULL if not possible.
1243  * valid_subplans for runtime pruning, valid mergeplans indexes to
1244  * scan.
1245  * ----------------
1246  */
1247 typedef struct MergeAppendState
1248 {
1249  PlanState ps; /* its first field is NodeTag */
1250  PlanState **mergeplans; /* array of PlanStates for my inputs */
1253  SortSupport ms_sortkeys; /* array of length ms_nkeys */
1254  TupleTableSlot **ms_slots; /* array of length ms_nplans */
1255  struct binaryheap *ms_heap; /* binary heap of slot indices */
1256  bool ms_initialized; /* are subplans started? */
1260 
1261 /* ----------------
1262  * RecursiveUnionState information
1263  *
1264  * RecursiveUnionState is used for performing a recursive union.
1265  *
1266  * recursing T when we're done scanning the non-recursive term
1267  * intermediate_empty T if intermediate_table is currently empty
1268  * working_table working table (to be scanned by recursive term)
1269  * intermediate_table current recursive output (next generation of WT)
1270  * ----------------
1271  */
1272 typedef struct RecursiveUnionState
1273 {
1274  PlanState ps; /* its first field is NodeTag */
1279  /* Remaining fields are unused in UNION ALL case */
1280  Oid *eqfuncoids; /* per-grouping-field equality fns */
1281  FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
1282  MemoryContext tempContext; /* short-term context for comparisons */
1283  TupleHashTable hashtable; /* hash table for tuples already seen */
1284  MemoryContext tableContext; /* memory context containing hash table */
1286 
1287 /* ----------------
1288  * BitmapAndState information
1289  * ----------------
1290  */
1291 typedef struct BitmapAndState
1292 {
1293  PlanState ps; /* its first field is NodeTag */
1294  PlanState **bitmapplans; /* array of PlanStates for my inputs */
1295  int nplans; /* number of input plans */
1296 } BitmapAndState;
1297 
1298 /* ----------------
1299  * BitmapOrState information
1300  * ----------------
1301  */
1302 typedef struct BitmapOrState
1303 {
1304  PlanState ps; /* its first field is NodeTag */
1305  PlanState **bitmapplans; /* array of PlanStates for my inputs */
1306  int nplans; /* number of input plans */
1307 } BitmapOrState;
1308 
1309 /* ----------------------------------------------------------------
1310  * Scan State Information
1311  * ----------------------------------------------------------------
1312  */
1313 
1314 /* ----------------
1315  * ScanState information
1316  *
1317  * ScanState extends PlanState for node types that represent
1318  * scans of an underlying relation. It can also be used for nodes
1319  * that scan the output of an underlying plan node --- in that case,
1320  * only ScanTupleSlot is actually useful, and it refers to the tuple
1321  * retrieved from the subplan.
1322  *
1323  * currentRelation relation being scanned (NULL if none)
1324  * currentScanDesc current scan descriptor for scan (NULL if none)
1325  * ScanTupleSlot pointer to slot in tuple table holding scan tuple
1326  * ----------------
1327  */
1328 typedef struct ScanState
1329 {
1330  PlanState ps; /* its first field is NodeTag */
1334 } ScanState;
1335 
1336 /* ----------------
1337  * SeqScanState information
1338  * ----------------
1339  */
1340 typedef struct SeqScanState
1341 {
1342  ScanState ss; /* its first field is NodeTag */
1343  Size pscan_len; /* size of parallel heap scan descriptor */
1344 } SeqScanState;
1345 
1346 /* ----------------
1347  * SampleScanState information
1348  * ----------------
1349  */
1350 typedef struct SampleScanState
1351 {
1353  List *args; /* expr states for TABLESAMPLE params */
1354  ExprState *repeatable; /* expr state for REPEATABLE expr */
1355  /* use struct pointer to avoid including tsmapi.h here */
1356  struct TsmRoutine *tsmroutine; /* descriptor for tablesample method */
1357  void *tsm_state; /* tablesample method can keep state here */
1358  bool use_bulkread; /* use bulkread buffer access strategy? */
1359  bool use_pagemode; /* use page-at-a-time visibility checking? */
1360  bool begun; /* false means need to call BeginSampleScan */
1361  uint32 seed; /* random seed */
1362  int64 donetuples; /* number of tuples already returned */
1363  bool haveblock; /* has a block for sampling been determined */
1364  bool done; /* exhausted all tuples? */
1365 } SampleScanState;
1366 
1367 /*
1368  * These structs store information about index quals that don't have simple
1369  * constant right-hand sides. See comments for ExecIndexBuildScanKeys()
1370  * for discussion.
1371  */
1372 typedef struct
1373 {
1374  struct ScanKeyData *scan_key; /* scankey to put value into */
1375  ExprState *key_expr; /* expr to evaluate to get value */
1376  bool key_toastable; /* is expr's result a toastable datatype? */
1378 
1379 typedef struct
1380 {
1381  struct ScanKeyData *scan_key; /* scankey to put value into */
1382  ExprState *array_expr; /* expr to evaluate to get array value */
1383  int next_elem; /* next array element to use */
1384  int num_elems; /* number of elems in current array value */
1385  Datum *elem_values; /* array of num_elems Datums */
1386  bool *elem_nulls; /* array of num_elems is-null flags */
1388 
1389 /* ----------------
1390  * IndexScanState information
1391  *
1392  * indexqualorig execution state for indexqualorig expressions
1393  * indexorderbyorig execution state for indexorderbyorig expressions
1394  * ScanKeys Skey structures for index quals
1395  * NumScanKeys number of ScanKeys
1396  * OrderByKeys Skey structures for index ordering operators
1397  * NumOrderByKeys number of OrderByKeys
1398  * RuntimeKeys info about Skeys that must be evaluated at runtime
1399  * NumRuntimeKeys number of RuntimeKeys
1400  * RuntimeKeysReady true if runtime Skeys have been computed
1401  * RuntimeContext expr context for evaling runtime Skeys
1402  * RelationDesc index relation descriptor
1403  * ScanDesc index scan descriptor
1404  *
1405  * ReorderQueue tuples that need reordering due to re-check
1406  * ReachedEnd have we fetched all tuples from index already?
1407  * OrderByValues values of ORDER BY exprs of last fetched tuple
1408  * OrderByNulls null flags for OrderByValues
1409  * SortSupport for reordering ORDER BY exprs
1410  * OrderByTypByVals is the datatype of order by expression pass-by-value?
1411  * OrderByTypLens typlens of the datatypes of order by expressions
1412  * PscanLen size of parallel index scan descriptor
1413  * ----------------
1414  */
1415 typedef struct IndexScanState
1416 {
1417  ScanState ss; /* its first field is NodeTag */
1430 
1431  /* These are needed for re-checking ORDER BY expr ordering */
1440 } IndexScanState;
1441 
1442 /* ----------------
1443  * IndexOnlyScanState information
1444  *
1445  * indexqual execution state for indexqual expressions
1446  * ScanKeys Skey structures for index quals
1447  * NumScanKeys number of ScanKeys
1448  * OrderByKeys Skey structures for index ordering operators
1449  * NumOrderByKeys number of OrderByKeys
1450  * RuntimeKeys info about Skeys that must be evaluated at runtime
1451  * NumRuntimeKeys number of RuntimeKeys
1452  * RuntimeKeysReady true if runtime Skeys have been computed
1453  * RuntimeContext expr context for evaling runtime Skeys
1454  * RelationDesc index relation descriptor
1455  * ScanDesc index scan descriptor
1456  * TableSlot slot for holding tuples fetched from the table
1457  * VMBuffer buffer in use for visibility map testing, if any
1458  * PscanLen size of parallel index-only scan descriptor
1459  * ----------------
1460  */
1461 typedef struct IndexOnlyScanState
1462 {
1463  ScanState ss; /* its first field is NodeTag */
1479 
1480 /* ----------------
1481  * BitmapIndexScanState information
1482  *
1483  * result bitmap to return output into, or NULL
1484  * ScanKeys Skey structures for index quals
1485  * NumScanKeys number of ScanKeys
1486  * RuntimeKeys info about Skeys that must be evaluated at runtime
1487  * NumRuntimeKeys number of RuntimeKeys
1488  * ArrayKeys info about Skeys that come from ScalarArrayOpExprs
1489  * NumArrayKeys number of ArrayKeys
1490  * RuntimeKeysReady true if runtime Skeys have been computed
1491  * RuntimeContext expr context for evaling runtime Skeys
1492  * RelationDesc index relation descriptor
1493  * ScanDesc index scan descriptor
1494  * ----------------
1495  */
1496 typedef struct BitmapIndexScanState
1497 {
1498  ScanState ss; /* its first field is NodeTag */
1511 
1512 /* ----------------
1513  * SharedBitmapState information
1514  *
1515  * BM_INITIAL TIDBitmap creation is not yet started, so first worker
1516  * to see this state will set the state to BM_INPROGRESS
1517  * and that process will be responsible for creating
1518  * TIDBitmap.
1519  * BM_INPROGRESS TIDBitmap creation is in progress; workers need to
1520  * sleep until it's finished.
1521  * BM_FINISHED TIDBitmap creation is done, so now all workers can
1522  * proceed to iterate over TIDBitmap.
1523  * ----------------
1524  */
1525 typedef enum
1526 {
1531 
1532 /* ----------------
1533  * ParallelBitmapHeapState information
1534  * tbmiterator iterator for scanning current pages
1535  * prefetch_iterator iterator for prefetching ahead of current page
1536  * mutex mutual exclusion for the prefetching variable
1537  * and state
1538  * prefetch_pages # pages prefetch iterator is ahead of current
1539  * prefetch_target current target prefetch distance
1540  * state current state of the TIDBitmap
1541  * cv conditional wait variable
1542  * phs_snapshot_data snapshot data shared to workers
1543  * ----------------
1544  */
1546 {
1554  char phs_snapshot_data[FLEXIBLE_ARRAY_MEMBER];
1556 
1557 /* ----------------
1558  * BitmapHeapScanState information
1559  *
1560  * bitmapqualorig execution state for bitmapqualorig expressions
1561  * tbm bitmap obtained from child index scan(s)
1562  * tbmiterator iterator for scanning current pages
1563  * tbmres current-page data
1564  * can_skip_fetch can we potentially skip tuple fetches in this scan?
1565  * return_empty_tuples number of empty tuples to return
1566  * vmbuffer buffer for visibility-map lookups
1567  * pvmbuffer ditto, for prefetched pages
1568  * exact_pages total number of exact pages retrieved
1569  * lossy_pages total number of lossy pages retrieved
1570  * prefetch_iterator iterator for prefetching ahead of current page
1571  * prefetch_pages # pages prefetch iterator is ahead of current
1572  * prefetch_target current target prefetch distance
1573  * prefetch_maximum maximum value for prefetch_target
1574  * pscan_len size of the shared memory for parallel bitmap
1575  * initialized is node is ready to iterate
1576  * shared_tbmiterator shared iterator
1577  * shared_prefetch_iterator shared iterator for prefetching
1578  * pstate shared state for parallel bitmap scan
1579  * ----------------
1580  */
1581 typedef struct BitmapHeapScanState
1582 {
1583  ScanState ss; /* its first field is NodeTag */
1604 
1605 /* ----------------
1606  * TidScanState information
1607  *
1608  * tidexprs list of TidExpr structs (see nodeTidscan.c)
1609  * isCurrentOf scan has a CurrentOfExpr qual
1610  * NumTids number of tids in this scan
1611  * TidPtr index of currently fetched tid
1612  * TidList evaluated item pointers (array of size NumTids)
1613  * htup currently-fetched tuple, if any
1614  * ----------------
1615  */
1616 typedef struct TidScanState
1617 {
1618  ScanState ss; /* its first field is NodeTag */
1625 } TidScanState;
1626 
1627 /* ----------------
1628  * TidRangeScanState information
1629  *
1630  * trss_tidexprs list of TidOpExpr structs (see nodeTidrangescan.c)
1631  * trss_mintid the lowest TID in the scan range
1632  * trss_maxtid the highest TID in the scan range
1633  * trss_inScan is a scan currently in progress?
1634  * ----------------
1635  */
1636 typedef struct TidRangeScanState
1637 {
1638  ScanState ss; /* its first field is NodeTag */
1644 
1645 /* ----------------
1646  * SubqueryScanState information
1647  *
1648  * SubqueryScanState is used for scanning a sub-query in the range table.
1649  * ScanTupleSlot references the current output tuple of the sub-query.
1650  * ----------------
1651  */
1652 typedef struct SubqueryScanState
1653 {
1654  ScanState ss; /* its first field is NodeTag */
1657 
1658 /* ----------------
1659  * FunctionScanState information
1660  *
1661  * Function nodes are used to scan the results of a
1662  * function appearing in FROM (typically a function returning set).
1663  *
1664  * eflags node's capability flags
1665  * ordinality is this scan WITH ORDINALITY?
1666  * simple true if we have 1 function and no ordinality
1667  * ordinal current ordinal column value
1668  * nfuncs number of functions being executed
1669  * funcstates per-function execution states (private in
1670  * nodeFunctionscan.c)
1671  * argcontext memory context to evaluate function arguments in
1672  * ----------------
1673  */
1675 
1676 typedef struct FunctionScanState
1677 {
1678  ScanState ss; /* its first field is NodeTag */
1679  int eflags;
1681  bool simple;
1682  int64 ordinal;
1683  int nfuncs;
1684  struct FunctionScanPerFuncState *funcstates; /* array of length nfuncs */
1687 
1688 /* ----------------
1689  * ValuesScanState information
1690  *
1691  * ValuesScan nodes are used to scan the results of a VALUES list
1692  *
1693  * rowcontext per-expression-list context
1694  * exprlists array of expression lists being evaluated
1695  * exprstatelists array of expression state lists, for SubPlans only
1696  * array_len size of above arrays
1697  * curr_idx current array index (0-based)
1698  *
1699  * Note: ss.ps.ps_ExprContext is used to evaluate any qual or projection
1700  * expressions attached to the node. We create a second ExprContext,
1701  * rowcontext, in which to build the executor expression state for each
1702  * Values sublist. Resetting this context lets us get rid of expression
1703  * state for each row, avoiding major memory leakage over a long values list.
1704  * However, that doesn't work for sublists containing SubPlans, because a
1705  * SubPlan has to be connected up to the outer plan tree to work properly.
1706  * Therefore, for only those sublists containing SubPlans, we do expression
1707  * state construction at executor start, and store those pointers in
1708  * exprstatelists[]. NULL entries in that array correspond to simple
1709  * subexpressions that are handled as described above.
1710  * ----------------
1711  */
1712 typedef struct ValuesScanState
1713 {
1714  ScanState ss; /* its first field is NodeTag */
1720 } ValuesScanState;
1721 
1722 /* ----------------
1723  * TableFuncScanState node
1724  *
1725  * Used in table-expression functions like XMLTABLE.
1726  * ----------------
1727  */
1728 typedef struct TableFuncScanState
1729 {
1730  ScanState ss; /* its first field is NodeTag */
1731  ExprState *docexpr; /* state for document expression */
1732  ExprState *rowexpr; /* state for row-generating expression */
1733  List *colexprs; /* state for column-generating expression */
1734  List *coldefexprs; /* state for column default expressions */
1735  List *ns_names; /* same as TableFunc.ns_names */
1736  List *ns_uris; /* list of states of namespace URI exprs */
1737  Bitmapset *notnulls; /* nullability flag for each output column */
1738  void *opaque; /* table builder private space */
1739  const struct TableFuncRoutine *routine; /* table builder methods */
1740  FmgrInfo *in_functions; /* input function for each column */
1741  Oid *typioparams; /* typioparam for each column */
1742  int64 ordinal; /* row number to be output next */
1743  MemoryContext perTableCxt; /* per-table context */
1744  Tuplestorestate *tupstore; /* output tuple store */
1746 
1747 /* ----------------
1748  * CteScanState information
1749  *
1750  * CteScan nodes are used to scan a CommonTableExpr query.
1751  *
1752  * Multiple CteScan nodes can read out from the same CTE query. We use
1753  * a tuplestore to hold rows that have been read from the CTE query but
1754  * not yet consumed by all readers.
1755  * ----------------
1756  */
1757 typedef struct CteScanState
1758 {
1759  ScanState ss; /* its first field is NodeTag */
1760  int eflags; /* capability flags to pass to tuplestore */
1761  int readptr; /* index of my tuplestore read pointer */
1762  PlanState *cteplanstate; /* PlanState for the CTE query itself */
1763  /* Link to the "leader" CteScanState (possibly this same node) */
1765  /* The remaining fields are only valid in the "leader" CteScanState */
1766  Tuplestorestate *cte_table; /* rows already read from the CTE query */
1767  bool eof_cte; /* reached end of CTE query? */
1768 } CteScanState;
1769 
1770 /* ----------------
1771  * NamedTuplestoreScanState information
1772  *
1773  * NamedTuplestoreScan nodes are used to scan a Tuplestore created and
1774  * named prior to execution of the query. An example is a transition
1775  * table for an AFTER trigger.
1776  *
1777  * Multiple NamedTuplestoreScan nodes can read out from the same Tuplestore.
1778  * ----------------
1779  */
1781 {
1782  ScanState ss; /* its first field is NodeTag */
1783  int readptr; /* index of my tuplestore read pointer */
1784  TupleDesc tupdesc; /* format of the tuples in the tuplestore */
1785  Tuplestorestate *relation; /* the rows */
1787 
1788 /* ----------------
1789  * WorkTableScanState information
1790  *
1791  * WorkTableScan nodes are used to scan the work table created by
1792  * a RecursiveUnion node. We locate the RecursiveUnion node
1793  * during executor startup.
1794  * ----------------
1795  */
1796 typedef struct WorkTableScanState
1797 {
1798  ScanState ss; /* its first field is NodeTag */
1801 
1802 /* ----------------
1803  * ForeignScanState information
1804  *
1805  * ForeignScan nodes are used to scan foreign-data tables.
1806  * ----------------
1807  */
1808 typedef struct ForeignScanState
1809 {
1810  ScanState ss; /* its first field is NodeTag */
1811  ExprState *fdw_recheck_quals; /* original quals not in ss.ps.qual */
1812  Size pscan_len; /* size of parallel coordination information */
1813  ResultRelInfo *resultRelInfo; /* result rel info, if UPDATE or DELETE */
1814  /* use struct pointer to avoid including fdwapi.h here */
1816  void *fdw_state; /* foreign-data wrapper can keep state here */
1818 
1819 /* ----------------
1820  * CustomScanState information
1821  *
1822  * CustomScan nodes are used to execute custom code within executor.
1823  *
1824  * Core code must avoid assuming that the CustomScanState is only as large as
1825  * the structure declared here; providers are allowed to make it the first
1826  * element in a larger structure, and typically would need to do so. The
1827  * struct is actually allocated by the CreateCustomScanState method associated
1828  * with the plan node. Any additional fields can be initialized there, or in
1829  * the BeginCustomScan method.
1830  * ----------------
1831  */
1832 struct CustomExecMethods;
1833 
1834 typedef struct CustomScanState
1835 {
1837  uint32 flags; /* mask of CUSTOMPATH_* flags, see
1838  * nodes/extensible.h */
1839  List *custom_ps; /* list of child PlanState nodes, if any */
1840  Size pscan_len; /* size of parallel coordination information */
1842 } CustomScanState;
1843 
1844 /* ----------------------------------------------------------------
1845  * Join State Information
1846  * ----------------------------------------------------------------
1847  */
1848 
1849 /* ----------------
1850  * JoinState information
1851  *
1852  * Superclass for state nodes of join plans.
1853  * ----------------
1854  */
1855 typedef struct JoinState
1856 {
1859  bool single_match; /* True if we should skip to next outer tuple
1860  * after finding one inner match */
1861  ExprState *joinqual; /* JOIN quals (in addition to ps.qual) */
1862 } JoinState;
1863 
1864 /* ----------------
1865  * NestLoopState information
1866  *
1867  * NeedNewOuter true if need new outer tuple on next call
1868  * MatchedOuter true if found a join match for current outer tuple
1869  * NullInnerTupleSlot prepared null tuple for left outer joins
1870  * ----------------
1871  */
1872 typedef struct NestLoopState
1873 {
1874  JoinState js; /* its first field is NodeTag */
1878 } NestLoopState;
1879 
1880 /* ----------------
1881  * MergeJoinState information
1882  *
1883  * NumClauses number of mergejoinable join clauses
1884  * Clauses info for each mergejoinable clause
1885  * JoinState current state of ExecMergeJoin state machine
1886  * SkipMarkRestore true if we may skip Mark and Restore operations
1887  * ExtraMarks true to issue extra Mark operations on inner scan
1888  * ConstFalseJoin true if we have a constant-false joinqual
1889  * FillOuter true if should emit unjoined outer tuples anyway
1890  * FillInner true if should emit unjoined inner tuples anyway
1891  * MatchedOuter true if found a join match for current outer tuple
1892  * MatchedInner true if found a join match for current inner tuple
1893  * OuterTupleSlot slot in tuple table for cur outer tuple
1894  * InnerTupleSlot slot in tuple table for cur inner tuple
1895  * MarkedTupleSlot slot in tuple table for marked tuple
1896  * NullOuterTupleSlot prepared null tuple for right outer joins
1897  * NullInnerTupleSlot prepared null tuple for left outer joins
1898  * OuterEContext workspace for computing outer tuple's join values
1899  * InnerEContext workspace for computing inner tuple's join values
1900  * ----------------
1901  */
1902 /* private in nodeMergejoin.c: */
1904 
1905 typedef struct MergeJoinState
1906 {
1907  JoinState js; /* its first field is NodeTag */
1909  MergeJoinClause mj_Clauses; /* array of length mj_NumClauses */
1925 } MergeJoinState;
1926 
1927 /* ----------------
1928  * HashJoinState information
1929  *
1930  * hashclauses original form of the hashjoin condition
1931  * hj_OuterHashKeys the outer hash keys in the hashjoin condition
1932  * hj_HashOperators the join operators in the hashjoin condition
1933  * hj_HashTable hash table for the hashjoin
1934  * (NULL if table not built yet)
1935  * hj_CurHashValue hash value for current outer tuple
1936  * hj_CurBucketNo regular bucket# for current outer tuple
1937  * hj_CurSkewBucketNo skew bucket# for current outer tuple
1938  * hj_CurTuple last inner tuple matched to current outer
1939  * tuple, or NULL if starting search
1940  * (hj_CurXXX variables are undefined if
1941  * OuterTupleSlot is empty!)
1942  * hj_OuterTupleSlot tuple slot for outer tuples
1943  * hj_HashTupleSlot tuple slot for inner (hashed) tuples
1944  * hj_NullOuterTupleSlot prepared null tuple for right/full outer joins
1945  * hj_NullInnerTupleSlot prepared null tuple for left/full outer joins
1946  * hj_FirstOuterTupleSlot first tuple retrieved from outer plan
1947  * hj_JoinState current state of ExecHashJoin state machine
1948  * hj_MatchedOuter true if found a join match for current outer
1949  * hj_OuterNotEmpty true if outer relation known not empty
1950  * ----------------
1951  */
1952 
1953 /* these structs are defined in executor/hashjoin.h: */
1956 
1957 typedef struct HashJoinState
1958 {
1959  JoinState js; /* its first field is NodeTag */
1961  List *hj_OuterHashKeys; /* list of ExprState nodes */
1962  List *hj_HashOperators; /* list of operator OIDs */
1964  HashJoinTable hj_HashTable;
1968  HashJoinTuple hj_CurTuple;
1977 } HashJoinState;
1978 
1979 
1980 /* ----------------------------------------------------------------
1981  * Materialization State Information
1982  * ----------------------------------------------------------------
1983  */
1984 
1985 /* ----------------
1986  * MaterialState information
1987  *
1988  * materialize nodes are used to materialize the results
1989  * of a subplan into a temporary file.
1990  *
1991  * ss.ss_ScanTupleSlot refers to output of underlying plan.
1992  * ----------------
1993  */
1994 typedef struct MaterialState
1995 {
1996  ScanState ss; /* its first field is NodeTag */
1997  int eflags; /* capability flags to pass to tuplestore */
1998  bool eof_underlying; /* reached end of underlying plan? */
2000 } MaterialState;
2001 
2002 
2003 /* ----------------
2004  * When performing sorting by multiple keys, it's possible that the input
2005  * dataset is already sorted on a prefix of those keys. We call these
2006  * "presorted keys".
2007  * PresortedKeyData represents information about one such key.
2008  * ----------------
2009  */
2010 typedef struct PresortedKeyData
2011 {
2012  FmgrInfo flinfo; /* comparison function info */
2013  FunctionCallInfo fcinfo; /* comparison function call info */
2014  OffsetNumber attno; /* attribute number in tuple */
2016 
2017 /* ----------------
2018  * Shared memory container for per-worker sort information
2019  * ----------------
2020  */
2021 typedef struct SharedSortInfo
2022 {
2025 } SharedSortInfo;
2026 
2027 /* ----------------
2028  * SortState information
2029  * ----------------
2030  */
2031 typedef struct SortState
2032 {
2033  ScanState ss; /* its first field is NodeTag */
2034  bool randomAccess; /* need random access to sort output? */
2035  bool bounded; /* is the result set bounded? */
2036  int64 bound; /* if bounded, how many tuples are needed */
2037  bool sort_Done; /* sort completed yet? */
2038  bool bounded_Done; /* value of bounded we did the sort with */
2039  int64 bound_Done; /* value of bound we did the sort with */
2040  void *tuplesortstate; /* private state of tuplesort.c */
2041  bool am_worker; /* are we a worker? */
2042  SharedSortInfo *shared_info; /* one entry per worker */
2043 } SortState;
2044 
2045 /* ----------------
2046  * Instrumentation information for IncrementalSort
2047  * ----------------
2048  */
2050 {
2051  int64 groupCount;
2056  bits32 sortMethods; /* bitmask of TuplesortMethod */
2058 
2059 typedef struct IncrementalSortInfo
2060 {
2064 
2065 /* ----------------
2066  * Shared memory container for per-worker incremental sort information
2067  * ----------------
2068  */
2070 {
2074 
2075 /* ----------------
2076  * IncrementalSortState information
2077  * ----------------
2078  */
2079 typedef enum
2080 {
2086 
2087 typedef struct IncrementalSortState
2088 {
2089  ScanState ss; /* its first field is NodeTag */
2090  bool bounded; /* is the result set bounded? */
2091  int64 bound; /* if bounded, how many tuples are needed */
2092  bool outerNodeDone; /* finished fetching tuples from outer node */
2093  int64 bound_Done; /* value of bound we did the sort with */
2096  Tuplesortstate *fullsort_state; /* private state of tuplesort.c */
2097  Tuplesortstate *prefixsort_state; /* private state of tuplesort.c */
2098  /* the keys by which the input path is already sorted */
2100 
2102 
2103  /* slot for pivot tuple defining values of presorted keys within group */
2106  bool am_worker; /* are we a worker? */
2107  SharedIncrementalSortInfo *shared_info; /* one entry per worker */
2109 
2110 /* ---------------------
2111  * GroupState information
2112  * ---------------------
2113  */
2114 typedef struct GroupState
2115 {
2116  ScanState ss; /* its first field is NodeTag */
2117  ExprState *eqfunction; /* equality function */
2118  bool grp_done; /* indicates completion of Group scan */
2119 } GroupState;
2120 
2121 /* ---------------------
2122  * per-worker aggregate information
2123  * ---------------------
2124  */
2126 {
2127  Size hash_mem_peak; /* peak hash table memory usage */
2128  uint64 hash_disk_used; /* kB of disk space used */
2129  int hash_batches_used; /* batches used during entire execution */
2131 
2132 /* ----------------
2133  * Shared memory container for per-worker aggregate information
2134  * ----------------
2135  */
2136 typedef struct SharedAggInfo
2137 {
2140 } SharedAggInfo;
2141 
2142 /* ---------------------
2143  * AggState information
2144  *
2145  * ss.ss_ScanTupleSlot refers to output of underlying plan.
2146  *
2147  * Note: ss.ps.ps_ExprContext contains ecxt_aggvalues and
2148  * ecxt_aggnulls arrays, which hold the computed agg values for the current
2149  * input group during evaluation of an Agg node's output tuple(s). We
2150  * create a second ExprContext, tmpcontext, in which to evaluate input
2151  * expressions and run the aggregate transition functions.
2152  * ---------------------
2153  */
2154 /* these structs are private in nodeAgg.c: */
2160 
2161 typedef struct AggState
2162 {
2163  ScanState ss; /* its first field is NodeTag */
2164  List *aggs; /* all Aggref nodes in targetlist & quals */
2165  int numaggs; /* length of list (could be zero!) */
2166  int numtrans; /* number of pertrans items */
2167  AggStrategy aggstrategy; /* strategy mode */
2168  AggSplit aggsplit; /* agg-splitting mode, see nodes.h */
2169  AggStatePerPhase phase; /* pointer to current phase data */
2170  int numphases; /* number of phases (including phase 0) */
2171  int current_phase; /* current phase number */
2172  AggStatePerAgg peragg; /* per-Aggref information */
2173  AggStatePerTrans pertrans; /* per-Trans state information */
2174  ExprContext *hashcontext; /* econtexts for long-lived data (hashtable) */
2175  ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */
2176  ExprContext *tmpcontext; /* econtext for input expressions */
2177 #define FIELDNO_AGGSTATE_CURAGGCONTEXT 14
2178  ExprContext *curaggcontext; /* currently active aggcontext */
2179  AggStatePerAgg curperagg; /* currently active aggregate, if any */
2180 #define FIELDNO_AGGSTATE_CURPERTRANS 16
2181  AggStatePerTrans curpertrans; /* currently active trans state, if any */
2182  bool input_done; /* indicates end of input */
2183  bool agg_done; /* indicates completion of Agg scan */
2184  int projected_set; /* The last projected grouping set */
2185 #define FIELDNO_AGGSTATE_CURRENT_SET 20
2186  int current_set; /* The current grouping set being evaluated */
2187  Bitmapset *grouped_cols; /* grouped cols in current projection */
2188  List *all_grouped_cols; /* list of all grouped cols in DESC order */
2189  Bitmapset *colnos_needed; /* all columns needed from the outer plan */
2190  int max_colno_needed; /* highest colno needed from outer plan */
2191  bool all_cols_needed; /* are all cols from outer plan needed? */
2192  /* These fields are for grouping set phase data */
2193  int maxsets; /* The max number of sets in any phase */
2194  AggStatePerPhase phases; /* array of all phases */
2195  Tuplesortstate *sort_in; /* sorted input to phases > 1 */
2196  Tuplesortstate *sort_out; /* input is copied here for next phase */
2197  TupleTableSlot *sort_slot; /* slot for sort results */
2198  /* these fields are used in AGG_PLAIN and AGG_SORTED modes: */
2199  AggStatePerGroup *pergroups; /* grouping set indexed array of per-group
2200  * pointers */
2201  HeapTuple grp_firstTuple; /* copy of first tuple of current group */
2202  /* these fields are used in AGG_HASHED and AGG_MIXED modes: */
2203  bool table_filled; /* hash table filled yet? */
2205  MemoryContext hash_metacxt; /* memory for hash table itself */
2206  struct HashTapeInfo *hash_tapeinfo; /* metadata for spill tapes */
2207  struct HashAggSpill *hash_spills; /* HashAggSpill for each grouping set,
2208  * exists only during first pass */
2209  TupleTableSlot *hash_spill_rslot; /* for reading spill files */
2210  TupleTableSlot *hash_spill_wslot; /* for writing spill files */
2211  List *hash_batches; /* hash batches remaining to be processed */
2212  bool hash_ever_spilled; /* ever spilled during this execution? */
2213  bool hash_spill_mode; /* we hit a limit during the current batch
2214  * and we must not create new groups */
2215  Size hash_mem_limit; /* limit before spilling hash table */
2216  uint64 hash_ngroups_limit; /* limit before spilling hash table */
2217  int hash_planned_partitions; /* number of partitions planned
2218  * for first pass */
2219  double hashentrysize; /* estimate revised during execution */
2220  Size hash_mem_peak; /* peak hash table memory usage */
2221  uint64 hash_ngroups_current; /* number of groups currently in
2222  * memory in all hash tables */
2223  uint64 hash_disk_used; /* kB of disk space used */
2224  int hash_batches_used; /* batches used during entire execution */
2225 
2226  AggStatePerHash perhash; /* array of per-hashtable data */
2227  AggStatePerGroup *hash_pergroup; /* grouping set indexed array of
2228  * per-group pointers */
2229 
2230  /* support for evaluation of agg input expressions: */
2231 #define FIELDNO_AGGSTATE_ALL_PERGROUPS 53
2232  AggStatePerGroup *all_pergroups; /* array of first ->pergroups, than
2233  * ->hash_pergroup */
2234  ProjectionInfo *combinedproj; /* projection machinery */
2235  SharedAggInfo *shared_info; /* one entry per worker */
2236 } AggState;
2237 
2238 /* ----------------
2239  * WindowAggState information
2240  * ----------------
2241  */
2242 /* these structs are private in nodeWindowAgg.c: */
2245 
2246 typedef struct WindowAggState
2247 {
2248  ScanState ss; /* its first field is NodeTag */
2249 
2250  /* these fields are filled in by ExecInitExpr: */
2251  List *funcs; /* all WindowFunc nodes in targetlist */
2252  int numfuncs; /* total number of window functions */
2253  int numaggs; /* number that are plain aggregates */
2254 
2255  WindowStatePerFunc perfunc; /* per-window-function information */
2256  WindowStatePerAgg peragg; /* per-plain-aggregate information */
2257  ExprState *partEqfunction; /* equality funcs for partition columns */
2258  ExprState *ordEqfunction; /* equality funcs for ordering columns */
2259  Tuplestorestate *buffer; /* stores rows of current partition */
2260  int current_ptr; /* read pointer # for current row */
2261  int framehead_ptr; /* read pointer # for frame head, if used */
2262  int frametail_ptr; /* read pointer # for frame tail, if used */
2263  int grouptail_ptr; /* read pointer # for group tail, if used */
2264  int64 spooled_rows; /* total # of rows in buffer */
2265  int64 currentpos; /* position of current row in partition */
2266  int64 frameheadpos; /* current frame head position */
2267  int64 frametailpos; /* current frame tail position (frame end+1) */
2268  /* use struct pointer to avoid including windowapi.h here */
2269  struct WindowObjectData *agg_winobj; /* winobj for aggregate fetches */
2270  int64 aggregatedbase; /* start row for current aggregates */
2271  int64 aggregatedupto; /* rows before this one are aggregated */
2272 
2273  int frameOptions; /* frame_clause options, see WindowDef */
2274  ExprState *startOffset; /* expression for starting bound offset */
2275  ExprState *endOffset; /* expression for ending bound offset */
2276  Datum startOffsetValue; /* result of startOffset evaluation */
2277  Datum endOffsetValue; /* result of endOffset evaluation */
2278 
2279  /* these fields are used with RANGE offset PRECEDING/FOLLOWING: */
2280  FmgrInfo startInRangeFunc; /* in_range function for startOffset */
2281  FmgrInfo endInRangeFunc; /* in_range function for endOffset */
2282  Oid inRangeColl; /* collation for in_range tests */
2283  bool inRangeAsc; /* use ASC sort order for in_range tests? */
2284  bool inRangeNullsFirst; /* nulls sort first for in_range tests? */
2285 
2286  /* these fields are used in GROUPS mode: */
2287  int64 currentgroup; /* peer group # of current row in partition */
2288  int64 frameheadgroup; /* peer group # of frame head row */
2289  int64 frametailgroup; /* peer group # of frame tail row */
2290  int64 groupheadpos; /* current row's peer group head position */
2291  int64 grouptailpos; /* " " " " tail position (group end+1) */
2292 
2293  MemoryContext partcontext; /* context for partition-lifespan data */
2294  MemoryContext aggcontext; /* shared context for aggregate working data */
2295  MemoryContext curaggcontext; /* current aggregate's working data */
2296  ExprContext *tmpcontext; /* short-term evaluation context */
2297 
2298  bool all_first; /* true if the scan is starting */
2299  bool all_done; /* true if the scan is finished */
2300  bool partition_spooled; /* true if all tuples in current partition
2301  * have been spooled into tuplestore */
2302  bool more_partitions; /* true if there's more partitions after
2303  * this one */
2304  bool framehead_valid; /* true if frameheadpos is known up to
2305  * date for current row */
2306  bool frametail_valid; /* true if frametailpos is known up to
2307  * date for current row */
2308  bool grouptail_valid; /* true if grouptailpos is known up to
2309  * date for current row */
2310 
2311  TupleTableSlot *first_part_slot; /* first tuple of current or next
2312  * partition */
2313  TupleTableSlot *framehead_slot; /* first tuple of current frame */
2314  TupleTableSlot *frametail_slot; /* first tuple after current frame */
2315 
2316  /* temporary slots for tuples fetched back from tuplestore */
2320 } WindowAggState;
2321 
2322 /* ----------------
2323  * UniqueState information
2324  *
2325  * Unique nodes are used "on top of" sort nodes to discard
2326  * duplicate tuples returned from the sort phase. Basically
2327  * all it does is compare the current tuple from the subplan
2328  * with the previously fetched tuple (stored in its result slot).
2329  * If the two are identical in all interesting fields, then
2330  * we just fetch another tuple from the sort and try again.
2331  * ----------------
2332  */
2333 typedef struct UniqueState
2334 {
2335  PlanState ps; /* its first field is NodeTag */
2336  ExprState *eqfunction; /* tuple equality qual */
2337 } UniqueState;
2338 
2339 /* ----------------
2340  * GatherState information
2341  *
2342  * Gather nodes launch 1 or more parallel workers, run a subplan
2343  * in those workers, and collect the results.
2344  * ----------------
2345  */
2346 typedef struct GatherState
2347 {
2348  PlanState ps; /* its first field is NodeTag */
2349  bool initialized; /* workers launched? */
2350  bool need_to_scan_locally; /* need to read from local plan? */
2351  int64 tuples_needed; /* tuple bound, see ExecSetTupleBound */
2352  /* these fields are set up once: */
2355  /* all remaining fields are reinitialized during a rescan: */
2356  int nworkers_launched; /* original number of workers */
2357  int nreaders; /* number of still-active workers */
2358  int nextreader; /* next one to try to read from */
2359  struct TupleQueueReader **reader; /* array with nreaders active entries */
2360 } GatherState;
2361 
2362 /* ----------------
2363  * GatherMergeState information
2364  *
2365  * Gather merge nodes launch 1 or more parallel workers, run a
2366  * subplan which produces sorted output in each worker, and then
2367  * merge the results into a single sorted stream.
2368  * ----------------
2369  */
2370 struct GMReaderTupleBuffer; /* private in nodeGatherMerge.c */
2371 
2372 typedef struct GatherMergeState
2373 {
2374  PlanState ps; /* its first field is NodeTag */
2375  bool initialized; /* workers launched? */
2376  bool gm_initialized; /* gather_merge_init() done? */
2377  bool need_to_scan_locally; /* need to read from local plan? */
2378  int64 tuples_needed; /* tuple bound, see ExecSetTupleBound */
2379  /* these fields are set up once: */
2380  TupleDesc tupDesc; /* descriptor for subplan result tuples */
2381  int gm_nkeys; /* number of sort columns */
2382  SortSupport gm_sortkeys; /* array of length gm_nkeys */
2384  /* all remaining fields are reinitialized during a rescan */
2385  /* (but the arrays are not reallocated, just cleared) */
2386  int nworkers_launched; /* original number of workers */
2387  int nreaders; /* number of active workers */
2388  TupleTableSlot **gm_slots; /* array with nreaders+1 entries */
2389  struct TupleQueueReader **reader; /* array with nreaders active entries */
2390  struct GMReaderTupleBuffer *gm_tuple_buffers; /* nreaders tuple buffers */
2391  struct binaryheap *gm_heap; /* binary heap of slot indices */
2393 
2394 /* ----------------
2395  * Values displayed by EXPLAIN ANALYZE
2396  * ----------------
2397  */
2398 typedef struct HashInstrumentation
2399 {
2400  int nbuckets; /* number of buckets at end of execution */
2401  int nbuckets_original; /* planned number of buckets */
2402  int nbatch; /* number of batches at end of execution */
2403  int nbatch_original; /* planned number of batches */
2404  Size space_peak; /* peak memory usage in bytes */
2406 
2407 /* ----------------
2408  * Shared memory container for per-worker hash information
2409  * ----------------
2410  */
2411 typedef struct SharedHashInfo
2412 {
2415 } SharedHashInfo;
2416 
2417 /* ----------------
2418  * HashState information
2419  * ----------------
2420  */
2421 typedef struct HashState
2422 {
2423  PlanState ps; /* its first field is NodeTag */
2424  HashJoinTable hashtable; /* hash table for the hashjoin */
2425  List *hashkeys; /* list of ExprState nodes */
2426 
2427  /*
2428  * In a parallelized hash join, the leader retains a pointer to the
2429  * shared-memory stats area in its shared_info field, and then copies the
2430  * shared-memory info back to local storage before DSM shutdown. The
2431  * shared_info field remains NULL in workers, or in non-parallel joins.
2432  */
2434 
2435  /*
2436  * If we are collecting hash stats, this points to an initially-zeroed
2437  * collection area, which could be either local storage or in shared
2438  * memory; either way it's for just one process.
2439  */
2441 
2442  /* Parallel hash state. */
2444 } HashState;
2445 
2446 /* ----------------
2447  * SetOpState information
2448  *
2449  * Even in "sorted" mode, SetOp nodes are more complex than a simple
2450  * Unique, since we have to count how many duplicates to return. But
2451  * we also support hashing, so this is really more like a cut-down
2452  * form of Agg.
2453  * ----------------
2454  */
2455 /* this struct is private in nodeSetOp.c: */
2457 
2458 typedef struct SetOpState
2459 {
2460  PlanState ps; /* its first field is NodeTag */
2461  ExprState *eqfunction; /* equality comparator */
2462  Oid *eqfuncoids; /* per-grouping-field equality fns */
2463  FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
2464  bool setop_done; /* indicates completion of output scan */
2465  long numOutput; /* number of dups left to output */
2466  /* these fields are used in SETOP_SORTED mode: */
2467  SetOpStatePerGroup pergroup; /* per-group working state */
2468  HeapTuple grp_firstTuple; /* copy of first tuple of current group */
2469  /* these fields are used in SETOP_HASHED mode: */
2470  TupleHashTable hashtable; /* hash table with one entry per group */
2471  MemoryContext tableContext; /* memory context containing hash table */
2472  bool table_filled; /* hash table filled yet? */
2473  TupleHashIterator hashiter; /* for iterating through hash table */
2474 } SetOpState;
2475 
2476 /* ----------------
2477  * LockRowsState information
2478  *
2479  * LockRows nodes are used to enforce FOR [KEY] UPDATE/SHARE locking.
2480  * ----------------
2481  */
2482 typedef struct LockRowsState
2483 {
2484  PlanState ps; /* its first field is NodeTag */
2485  List *lr_arowMarks; /* List of ExecAuxRowMarks */
2486  EPQState lr_epqstate; /* for evaluating EvalPlanQual rechecks */
2487 } LockRowsState;
2488 
2489 /* ----------------
2490  * LimitState information
2491  *
2492  * Limit nodes are used to enforce LIMIT/OFFSET clauses.
2493  * They just select the desired subrange of their subplan's output.
2494  *
2495  * offset is the number of initial tuples to skip (0 does nothing).
2496  * count is the number of tuples to return after skipping the offset tuples.
2497  * If no limit count was specified, count is undefined and noCount is true.
2498  * When lstate == LIMIT_INITIAL, offset/count/noCount haven't been set yet.
2499  * ----------------
2500  */
2501 typedef enum
2502 {
2503  LIMIT_INITIAL, /* initial state for LIMIT node */
2504  LIMIT_RESCAN, /* rescan after recomputing parameters */
2505  LIMIT_EMPTY, /* there are no returnable rows */
2506  LIMIT_INWINDOW, /* have returned a row in the window */
2507  LIMIT_WINDOWEND_TIES, /* have returned a tied row */
2508  LIMIT_SUBPLANEOF, /* at EOF of subplan (within window) */
2509  LIMIT_WINDOWEND, /* stepped off end of window */
2510  LIMIT_WINDOWSTART /* stepped off beginning of window */
2511 } LimitStateCond;
2512 
2513 typedef struct LimitState
2514 {
2515  PlanState ps; /* its first field is NodeTag */
2516  ExprState *limitOffset; /* OFFSET parameter, or NULL if none */
2517  ExprState *limitCount; /* COUNT parameter, or NULL if none */
2518  LimitOption limitOption; /* limit specification type */
2519  int64 offset; /* current OFFSET value */
2520  int64 count; /* current COUNT, if any */
2521  bool noCount; /* if true, ignore count */
2522  LimitStateCond lstate; /* state machine status, as above */
2523  int64 position; /* 1-based index of last tuple returned */
2524  TupleTableSlot *subSlot; /* tuple last obtained from subplan */
2525  ExprState *eqfunction; /* tuple equality qual in case of WITH TIES
2526  * option */
2527  TupleTableSlot *last_slot; /* slot for evaluation of ties */
2528 } LimitState;
2529 
2530 #endif /* EXECNODES_H */
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1471
Datum * elem_values
Definition: execnodes.h:1385
JoinType jointype
Definition: execnodes.h:1858
ExprContext * exprcontext
Definition: execnodes.h:730
TupleTableSlot ** relsubs_slot
Definition: execnodes.h:1086
signed short int16
Definition: c.h:428
struct AggStatePerTransData * AggStatePerTrans
Definition: execnodes.h:2156
FmgrInfo func
Definition: execnodes.h:803
AttrNumber jf_junkAttNo
Definition: execnodes.h:372
int ri_NumIndices
Definition: execnodes.h:418
int slock_t
Definition: s_lock.h:934
struct HashAggSpill * hash_spills
Definition: execnodes.h:2207
struct ParallelHashJoinState * parallel_state
Definition: execnodes.h:2443
AggStatePerGroup * hash_pergroup
Definition: execnodes.h:2227
struct ScanKeyData * scan_key
Definition: execnodes.h:1374
Size pstate_len
Definition: execnodes.h:1226
struct GroupState GroupState
uint32 CommandId
Definition: c.h:601
NodeTag tag
Definition: execnodes.h:62
List * trss_tidexprs
Definition: execnodes.h:1639
ScanState ss
Definition: execnodes.h:1810
IndexRuntimeKeyInfo * biss_RuntimeKeys
Definition: execnodes.h:1502
struct TupleHashTableData TupleHashTableData
struct AggStatePerGroupData * AggStatePerGroup
Definition: execnodes.h:2157
struct IndexScanDescData * biss_ScanDesc
Definition: execnodes.h:1509
JunkFilter * ri_junkFilter
Definition: execnodes.h:474
MemoryContext ii_Context
Definition: execnodes.h:178
OffsetNumber attno
Definition: execnodes.h:2014
Definition: fmgr.h:56
AttrNumber * jf_cleanMap
Definition: execnodes.h:370
MemoryContext curaggcontext
Definition: execnodes.h:2295
struct TransitionCaptureState * mt_oc_transition_capture
Definition: execnodes.h:1195
JunkFilter * es_junkFilter
Definition: execnodes.h:541
struct dsa_area * es_query_dsa
Definition: execnodes.h:606
uint16 * ii_UniqueStrats
Definition: execnodes.h:169
NodeTag type
Definition: execnodes.h:939
bool rs_done
Definition: execnodes.h:1134
Relation ri_RelationDesc
Definition: execnodes.h:415
ExprState * endOffset
Definition: execnodes.h:2275
AggStatePerPhase phases
Definition: execnodes.h:2194
double hashentrysize
Definition: execnodes.h:2219
struct WindowFuncExprState WindowFuncExprState
struct GMReaderTupleBuffer * gm_tuple_buffers
Definition: execnodes.h:2390
TupleTableSlot * ioss_TableSlot
Definition: execnodes.h:1475
ProjectionInfo * projLeft
Definition: execnodes.h:867
int nworkers_launched
Definition: execnodes.h:2356
HeapTuple curTuple
Definition: execnodes.h:863
bool nl_MatchedOuter
Definition: execnodes.h:1876
Datum * ecxt_aggvalues
Definition: execnodes.h:244
const TupleTableSlotOps * innerops
Definition: execnodes.h:1015
uint64 hash_ngroups_limit
Definition: execnodes.h:2216
WorkerInstrumentation * worker_instrument
Definition: execnodes.h:952
struct WindowStatePerAggData * WindowStatePerAgg
Definition: execnodes.h:2244
TupleHashTable hashtable
Definition: execnodes.h:869
struct PlanState * parent
Definition: execnodes.h:107
ExprState * bitmapqualorig
Definition: execnodes.h:1584
MemoryContext tableContext
Definition: execnodes.h:2471
MemoryContext argcontext
Definition: execnodes.h:1152
NodeTag type
Definition: execnodes.h:330
TupleTableSlot * hj_NullInnerTupleSlot
Definition: execnodes.h:1972
Datum startOffsetValue
Definition: execnodes.h:2276
TupleTableSlot ** ms_slots
Definition: execnodes.h:1254
ExprState * aggfilter
Definition: execnodes.h:771
ExprContext * innerecontext
Definition: execnodes.h:875
ExprState * joinqual
Definition: execnodes.h:1861
List ** exprstatelists
Definition: execnodes.h:1717
List * ii_Predicate
Definition: execnodes.h:162
struct CopyMultiInsertBuffer * ri_CopyMultiInsertBuffer
Definition: execnodes.h:515
struct ScanState ScanState
CommandId es_output_cid
Definition: execnodes.h:544
PlanState ps
Definition: execnodes.h:1147
Tuplestorestate * tuplestorestate
Definition: execnodes.h:1999
ProjectionInfo * ps_ProjInfo
Definition: execnodes.h:981
SortSupport ms_sortkeys
Definition: execnodes.h:1253
Instrumentation * instrument
Definition: execnodes.h:951
struct SetOpStatePerGroupData * SetOpStatePerGroup
Definition: execnodes.h:2456
PlanState ps
Definition: execnodes.h:1304
NodeTag type
Definition: execnodes.h:221
Bitmapset * colnos_needed
Definition: execnodes.h:2189
ExprContext * mj_InnerEContext
Definition: execnodes.h:1924
bool bounded_Done
Definition: execnodes.h:2038
struct TidRangeScanState TidRangeScanState
TupleTableSlot ** ri_PlanSlots
Definition: execnodes.h:456
ExprState * eqfunction
Definition: execnodes.h:2461
Tuplestorestate * intermediate_table
Definition: execnodes.h:1278
struct JitContext * es_jit
Definition: execnodes.h:618
EPQState lr_epqstate
Definition: execnodes.h:2486
bool mj_ConstFalseJoin
Definition: execnodes.h:1913
struct PartitionPruneState * as_prune_state
Definition: execnodes.h:1227
struct PartitionTupleRouting * mt_partition_tuple_routing
Definition: execnodes.h:1189
struct ScanKeyData * scan_key
Definition: execnodes.h:1381
int numaggs
Definition: execnodes.h:2165
bool noCount
Definition: execnodes.h:2521
DomainConstraintType constrainttype
Definition: execnodes.h:905
Oid * eqfuncoids
Definition: execnodes.h:2462
bool agg_done
Definition: execnodes.h:2183
PlanState ps
Definition: execnodes.h:1857
struct WindowAggState WindowAggState
ScanState ss
Definition: execnodes.h:2248
struct PresortedKeyData PresortedKeyData
bool nl_NeedNewOuter
Definition: execnodes.h:1875
struct SetExprState SetExprState
TupleTableSlot * inputslot
Definition: execnodes.h:726
Relation relation
Definition: execnodes.h:644
IndexRuntimeKeyInfo * iss_RuntimeKeys
Definition: execnodes.h:1424
int64 groupheadpos
Definition: execnodes.h:2290
bool bounded
Definition: execnodes.h:2035
NodeTag type
Definition: execnodes.h:300
TupleTableSlot * sort_slot
Definition: execnodes.h:2197
List * initPlan
Definition: execnodes.h:966
List * all_grouped_cols
Definition: execnodes.h:2188
ResultRelInfo * resultRelInfo
Definition: execnodes.h:1170
Tuplesortstate * sort_out
Definition: execnodes.h:2196
struct ExprEvalStep * steps
Definition: execnodes.h:84
bool shutdown_reg
Definition: execnodes.h:841
ScanState ss
Definition: execnodes.h:2163
int16 * iss_OrderByTypLens
Definition: execnodes.h:1438
bool * innermost_casenull
Definition: execnodes.h:111
FmgrInfo * hashfunctions
Definition: execnodes.h:1281
ExprState * ii_PredicateState
Definition: execnodes.h:163
ExprContext * ps_ExprContext
Definition: execnodes.h:980
MinimalTuple firstTuple
Definition: execnodes.h:699
SortSupport iss_SortSupport
Definition: execnodes.h:1436
bool inneropsset
Definition: execnodes.h:1023
MemoryContext ecxt_per_tuple_memory
Definition: execnodes.h:233
LimitStateCond
Definition: execnodes.h:2501
struct JitInstrumentation * es_jit_worker_instr
Definition: execnodes.h:619
ExprState * ri_PartitionCheckExpr
Definition: execnodes.h:489
struct BitmapHeapScanState BitmapHeapScanState
tuplehash_iterator TupleHashIterator
Definition: execnodes.h:733
TupleTableSlot ** mt_scans
Definition: execnodes.h:1168
bool single_match
Definition: execnodes.h:1859
HashJoinTable hashtable
Definition: execnodes.h:2424
TIDBitmap * tbm
Definition: execnodes.h:1585
int64 bound
Definition: execnodes.h:2036
bool pending_srf_tuples
Definition: execnodes.h:1151
struct TableFuncScanState TableFuncScanState
struct HashInstrumentation HashInstrumentation
Relation biss_RelationDesc
Definition: execnodes.h:1508
List * subPlan
Definition: execnodes.h:968
ItemPointerData trss_maxtid
Definition: execnodes.h:1641
struct IncrementalSortState IncrementalSortState
Definition: jit.h:54
ParamListInfo ext_params
Definition: execnodes.h:108
void * tsm_state
Definition: execnodes.h:1357
TupleTableSlot * mj_MarkedTupleSlot
Definition: execnodes.h:1920
AttrNumber * keyColIdx
Definition: execnodes.h:717
unsigned char uint8
Definition: c.h:439
bool need_to_scan_locally
Definition: execnodes.h:2377
ExprState * tab_eq_func
Definition: execnodes.h:719
Instrumentation * ri_TrigInstrument
Definition: execnodes.h:436
PlannedStmt * es_plannedstmt
Definition: execnodes.h:538
PlanState ps
Definition: execnodes.h:2460
TupleConversionMap * ri_ChildToRootMap
Definition: execnodes.h:512
int64 currentgroup
Definition: execnodes.h:2287
SharedSortInfo * shared_info
Definition: execnodes.h:2042
int current_phase
Definition: execnodes.h:2171
ScanState ss
Definition: execnodes.h:1996
bool need_to_scan_locally
Definition: execnodes.h:2350
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:350
Definition: nodes.h:533
AggSplit aggsplit
Definition: execnodes.h:2168
Snapshot es_crosscheck_snapshot
Definition: execnodes.h:531
struct TableScanDescData * ss_currentScanDesc
Definition: execnodes.h:1332
Oid * ii_ExclusionProcs
Definition: execnodes.h:165
struct CteScanState * leader
Definition: execnodes.h:1764
ScanState ss
Definition: execnodes.h:1759
Bitmapset * ms_valid_subplans
Definition: execnodes.h:1258
int64 aggregatedupto
Definition: execnodes.h:2271
ExprState * cur_eq_func
Definition: execnodes.h:728
List * jf_targetList
Definition: execnodes.h:368
struct ExprState ExprState
TupleTableSlot * mj_NullInnerTupleSlot
Definition: execnodes.h:1922
bool ermActive
Definition: execnodes.h:652
TupleTableSlot * jf_resultSlot
Definition: execnodes.h:371
IndexRuntimeKeyInfo * ioss_RuntimeKeys
Definition: execnodes.h:1469
IncrementalSortGroupInfo prefixsortGroupInfo
Definition: execnodes.h:2062
LockWaitPolicy waitPolicy
Definition: execnodes.h:651
PresortedKeyData * presorted_keys
Definition: execnodes.h:2099
bool hj_MatchedOuter
Definition: execnodes.h:1975
ExprContext * es_per_tuple_exprcontext
Definition: execnodes.h:593
struct NamedTuplestoreScanState NamedTuplestoreScanState
struct SubqueryScanState SubqueryScanState
struct TupleQueueReader ** reader
Definition: execnodes.h:2359
Oid * tab_eq_funcoids
Definition: execnodes.h:879
CmdType operation
Definition: execnodes.h:1162
ScanState ss
Definition: execnodes.h:1342
Snapshot es_snapshot
Definition: execnodes.h:530
ResultRelInfo * rootResultRelInfo
Definition: execnodes.h:1176
struct SharedIncrementalSortInfo SharedIncrementalSortInfo
bool frametail_valid
Definition: execnodes.h:2306
TupleTableSlot ** gm_slots
Definition: execnodes.h:2388
HeapTuple grp_firstTuple
Definition: execnodes.h:2468
List * args
Definition: execnodes.h:789
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1333
TupleTableSlot ** ri_Slots
Definition: execnodes.h:455
bool am_worker
Definition: execnodes.h:2041
struct AggStatePerPhaseData * AggStatePerPhase
Definition: execnodes.h:2158
struct WindowStatePerFuncData * WindowStatePerFunc
Definition: execnodes.h:2243
ExprState * testexpr
Definition: execnodes.h:861
bool all_cols_needed
Definition: execnodes.h:2191
int64 frametailgroup
Definition: execnodes.h:2289
MemoryContext argcontext
Definition: execnodes.h:1685
PlanState ** bitmapplans
Definition: execnodes.h:1294
bool inneropsfixed
Definition: execnodes.h:1019
Datum * innermost_domainval
Definition: execnodes.h:113
int64 grouptailpos
Definition: execnodes.h:2291
TupleTableSlot * hash_spill_rslot
Definition: execnodes.h:2209
LockClauseStrength strength
Definition: execnodes.h:650
DomainConstraintType
Definition: execnodes.h:896
Relation ss_currentRelation
Definition: execnodes.h:1331
AggStatePerTrans pertrans
Definition: execnodes.h:2173
EState * state
Definition: execnodes.h:943
TupleTableSlot * hj_OuterTupleSlot
Definition: execnodes.h:1969
int projected_set
Definition: execnodes.h:2184
List * custom_ps
Definition: execnodes.h:1839
struct OnConflictSetState OnConflictSetState
LimitStateCond lstate
Definition: execnodes.h:2522
TupleTableSlot * resultslot
Definition: execnodes.h:79
List * es_range_table
Definition: execnodes.h:532
ExprState * fdw_recheck_quals
Definition: execnodes.h:1811
struct PlanState * righttree
Definition: execnodes.h:964
unsigned int Oid
Definition: postgres_ext.h:31
Datum domainValue_datum
Definition: execnodes.h:256
NodeTag
Definition: nodes.h:26
List * hj_OuterHashKeys
Definition: execnodes.h:1961
struct ExecRowMark ExecRowMark
HeapTuple grp_firstTuple
Definition: execnodes.h:2201
EState * parentestate
Definition: execnodes.h:1077
TupleTableSlot * ri_TrigNewSlot
Definition: execnodes.h:441
LimitOption limitOption
Definition: execnodes.h:2518
ExprState * limitCount
Definition: execnodes.h:2517
TupleTableSlot * temp_slot_1
Definition: execnodes.h:2318
int current_set
Definition: execnodes.h:2186
WindowStatePerFunc perfunc
Definition: execnodes.h:2255
TupleTableSlot * hj_FirstOuterTupleSlot
Definition: execnodes.h:1973
Oid * ii_UniqueOps
Definition: execnodes.h:167
Datum(* ExprStateEvalFunc)(struct ExprState *expression, struct ExprContext *econtext, bool *isNull)
Definition: execnodes.h:52
bool grp_done
Definition: execnodes.h:2118
struct ScanKeyData * biss_ScanKeys
Definition: execnodes.h:1500
ExprState * indexqualorig
Definition: execnodes.h:1418
int64 position
Definition: execnodes.h:2523
SharedBitmapState
Definition: execnodes.h:1525
ExprState * eqfunction
Definition: execnodes.h:2525
struct IndexScanDescData * ioss_ScanDesc
Definition: execnodes.h:1474
int numtrans
Definition: execnodes.h:2166
Size pscan_len
Definition: execnodes.h:1343
TupleTableSlot *(* ExecProcNodeMtd)(struct PlanState *pstate)
Definition: execnodes.h:928
struct ModifyTableState ModifyTableState
struct EPQState * es_epq_active
Definition: execnodes.h:601
ScanDirection es_direction
Definition: execnodes.h:529
List * indexorderbyorig
Definition: execnodes.h:1419
bool * innermost_domainnull
Definition: execnodes.h:114
PlanState ps
Definition: execnodes.h:2374
uint64 dsa_pointer
Definition: dsa.h:62
const TupleTableSlotOps * resultops
Definition: execnodes.h:1016
Index ri_RangeTableIndex
Definition: execnodes.h:412
ExprContext * tmpcontext
Definition: execnodes.h:2176
int64 count
Definition: execnodes.h:2520
PlanState ps
Definition: execnodes.h:1219
JoinType
Definition: nodes.h:700
struct PlanState * lefttree
Definition: execnodes.h:963
HeapTupleData tss_htup
Definition: execnodes.h:1624
struct HashJoinState HashJoinState
TupleTableSlot * first_part_slot
Definition: execnodes.h:2311
int max_colno_needed
Definition: execnodes.h:2190
uint16 OffsetNumber
Definition: off.h:24
bool hash_spill_mode
Definition: execnodes.h:2213
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:718
ScanState ss
Definition: execnodes.h:1714
ExecRowMark * rowmark
Definition: execnodes.h:671
ItemPointerData curCtid
Definition: execnodes.h:653
bool es_use_parallel_mode
Definition: execnodes.h:603
SharedHashInfo * shared_info
Definition: execnodes.h:2433
struct ExecRowMark ** es_rowmarks
Definition: execnodes.h:536
const struct CustomExecMethods * methods
Definition: execnodes.h:1841
struct SharedSortInfo SharedSortInfo
List * ri_WithCheckOptionExprs
Definition: execnodes.h:462
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:882
List * hash_batches
Definition: execnodes.h:2211
bool * iss_OrderByNulls
Definition: execnodes.h:1435
ScanState ss
Definition: execnodes.h:2116
ExprContext * tmpcontext
Definition: execnodes.h:2296
PlanState ps
Definition: execnodes.h:1330
struct WindowObjectData * agg_winobj
Definition: execnodes.h:2269
TupleTableSlot * oc_Existing
Definition: execnodes.h:384
bool inRangeNullsFirst
Definition: execnodes.h:2284
void * tuplesortstate
Definition: execnodes.h:2040
int64 frameheadpos
Definition: execnodes.h:2266
int maxsets
Definition: execnodes.h:2193
uint32 hj_CurHashValue
Definition: execnodes.h:1965
Tuplestorestate * funcResultStore
Definition: execnodes.h:810
const char * es_sourceText
Definition: execnodes.h:539
TupleDesc expectedDesc
Definition: execnodes.h:303
int hj_CurSkewBucketNo
Definition: execnodes.h:1967
List * ii_ExpressionsState
Definition: execnodes.h:161
ItemPointerData trss_mintid
Definition: execnodes.h:1640
struct ProjectSetState ProjectSetState
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:979
ParamExecData * es_param_exec_vals
Definition: execnodes.h:567
unsigned short uint16
Definition: c.h:440
IncrementalSortInfo incsort_info
Definition: execnodes.h:2101
MemoryContext es_query_cxt
Definition: execnodes.h:572
ExprState * cur_eq_comp
Definition: execnodes.h:886
ExprState * eqfunction
Definition: execnodes.h:2336
struct ParallelExecutorInfo * pei
Definition: execnodes.h:2383
struct FunctionScanState FunctionScanState
bool mj_MatchedOuter
Definition: execnodes.h:1916
PlanState ps
Definition: execnodes.h:1293
bool table_filled
Definition: execnodes.h:2203
AggStrategy aggstrategy
Definition: execnodes.h:2167
ExprState * partEqfunction
Definition: execnodes.h:2257
FmgrInfo * in_hash_funcs
Definition: execnodes.h:727
NodeTag type
Definition: execnodes.h:409
PlanState ps
Definition: execnodes.h:1161
EState * recheckestate
Definition: execnodes.h:1107
int ii_NumIndexKeyAttrs
Definition: execnodes.h:158
struct IncrementalSortGroupInfo IncrementalSortGroupInfo
int64 offset
Definition: execnodes.h:2519
bool initialized
Definition: execnodes.h:2349
Bitmapset * notnulls
Definition: execnodes.h:1737
struct PlanState * planstate
Definition: execnodes.h:859
TupleTableSlot * hj_NullOuterTupleSlot
Definition: execnodes.h:1971
bool resnull
Definition: execnodes.h:71
ProjectionInfo * oc_ProjInfo
Definition: execnodes.h:386
ScanState ss
Definition: execnodes.h:1618
ResultRelInfo * resultRelInfo
Definition: execnodes.h:1813
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1602
struct CustomScanState CustomScanState
struct ResultRelInfo ResultRelInfo
Expr * expr
Definition: execnodes.h:93
FmgrInfo endInRangeFunc
Definition: execnodes.h:2281
List * args
Definition: execnodes.h:862
SubPlan * subplan
Definition: execnodes.h:858
ExprState * eqfunction
Definition: execnodes.h:2117
ParallelAppendState * as_pstate
Definition: execnodes.h:1225
MemoryContext hash_metacxt
Definition: execnodes.h:2205
struct ParallelExecutorInfo * pei
Definition: execnodes.h:2354
Datum caseValue_datum
Definition: execnodes.h:250
PlanState ** bitmapplans
Definition: execnodes.h:1305
ExprContext_CB * ecxt_callbacks
Definition: execnodes.h:264
List * tss_tidexprs
Definition: execnodes.h:1619
NodeTag type
Definition: execnodes.h:367
struct SeqScanState SeqScanState
TupleTableSlot * ri_PartitionTupleSlot
Definition: execnodes.h:505
bool iss_ReachedEnd
Definition: execnodes.h:1433
struct ScanKeyData * ioss_ScanKeys
Definition: execnodes.h:1465
struct TupleHashEntryData TupleHashEntryData
List * arowMarks
Definition: execnodes.h:1094
struct HashJoinTupleData * HashJoinTuple
Definition: execnodes.h:1954
ExprState * resconstantqual
Definition: execnodes.h:1133
bool mj_MatchedInner
Definition: execnodes.h:1917
bool ri_usesFdwDirectModify
Definition: execnodes.h:450
struct ResultRelInfo * ri_RootResultRelInfo
Definition: execnodes.h:503
ScanState ss
Definition: execnodes.h:1836
Tuplesortstate * sort_in
Definition: execnodes.h:2195
AttrNumber * keyColIdx
Definition: execnodes.h:878
MemoryContext tempContext
Definition: execnodes.h:1282
ItemPointerData * tss_TidList
Definition: execnodes.h:1623
NodeTag type
Definition: execnodes.h:787
ExprState ** ri_TrigWhenExprs
Definition: execnodes.h:433
TupleTableSlot * temp_slot_2
Definition: execnodes.h:2319
PlanState ps
Definition: execnodes.h:2484
ExprState * key_expr
Definition: execnodes.h:1375
bool funcReturnsSet
Definition: execnodes.h:824
struct BitmapAndState BitmapAndState
const TupleTableSlotOps * scanops
Definition: execnodes.h:1013
Datum endOffsetValue
Definition: execnodes.h:2277
Index rti
Definition: execnodes.h:646
WindowStatePerAgg peragg
Definition: execnodes.h:2256
struct TransitionCaptureState * mt_transition_capture
Definition: execnodes.h:1192
ExprContext * ioss_RuntimeContext
Definition: execnodes.h:1472
ExprStateEvalFunc evalfunc
Definition: execnodes.h:90
struct MergeJoinClauseData * MergeJoinClause
Definition: execnodes.h:1903
ExprState * ordEqfunction
Definition: execnodes.h:2258
struct EPQState EPQState
void * ermExtra
Definition: execnodes.h:654
const struct TableFuncRoutine * routine
Definition: execnodes.h:1739
int iss_NumRuntimeKeys
Definition: execnodes.h:1425
struct MergeJoinState MergeJoinState
ExprState * startOffset
Definition: execnodes.h:2274
int64 frameheadgroup
Definition: execnodes.h:2288
MemoryContext tablecxt
Definition: execnodes.h:721
int es_jit_flags
Definition: execnodes.h:617
struct ExecAuxRowMark ExecAuxRowMark
TupleDesc jf_cleanTupType
Definition: execnodes.h:369
AttrNumber wholeAttNo
Definition: execnodes.h:674
HashJoinTuple hj_CurTuple
Definition: execnodes.h:1968
Oid * ii_UniqueProcs
Definition: execnodes.h:168
PlanState ps
Definition: execnodes.h:2335
bool table_filled
Definition: execnodes.h:2472
TupleTableSlot * ri_ReturningSlot
Definition: execnodes.h:439
List * es_opened_result_relations
Definition: execnodes.h:550
int64 aggregatedbase
Definition: execnodes.h:2270
Index prti
Definition: execnodes.h:647
List * tuple_table
Definition: execnodes.h:1085
struct ExprContext ExprContext
ExprState * docexpr
Definition: execnodes.h:1731
ScanDirection
Definition: sdir.h:22
EPQState mt_epqstate
Definition: execnodes.h:1179
bool * iss_OrderByTypByVals
Definition: execnodes.h:1437
struct TupleHashTableData * TupleHashTable
Definition: execnodes.h:695
long numOutput
Definition: execnodes.h:2465
bool tss_isCurrentOf
Definition: execnodes.h:1620
PlanState ** mergeplans
Definition: execnodes.h:1250
struct ValuesScanState ValuesScanState
struct AggStatePerHashData * AggStatePerHash
Definition: execnodes.h:2159
ExprState ** ri_GeneratedExprs
Definition: execnodes.h:468
TupleTableSlot * ecxt_innertuple
Definition: execnodes.h:227
bool havenullrows
Definition: execnodes.h:872
ParamExecData * ecxt_param_exec_vals
Definition: execnodes.h:236
int hash_planned_partitions
Definition: execnodes.h:2217
IncrementalSortExecutionStatus
Definition: execnodes.h:2079
ExprState * limitOffset
Definition: execnodes.h:2516
FmgrInfo flinfo
Definition: execnodes.h:2012
ExprState * check_exprstate
Definition: execnodes.h:908
struct AggregateInstrumentation AggregateInstrumentation
struct MaterialState MaterialState
struct EState * ecxt_estate
Definition: execnodes.h:261
struct ProjectionInfo ProjectionInfo
List * hashkeys
Definition: execnodes.h:2425
struct HashState HashState
ProjectionInfo * ri_projectReturning
Definition: execnodes.h:480
bool eof_underlying
Definition: execnodes.h:1998
struct FdwRoutine * ri_FdwRoutine
Definition: execnodes.h:444
bool ii_BrokenHotChain
Definition: execnodes.h:174
unsigned int uint32
Definition: c.h:441
PlanState ps
Definition: execnodes.h:2423
int64 bound_Done
Definition: execnodes.h:2039
struct FdwRoutine * fdwroutine
Definition: execnodes.h:1815
AggStatePerAgg curperagg
Definition: execnodes.h:2179
struct PlanState * parent
Definition: execnodes.h:860
struct binaryheap * gm_heap
Definition: execnodes.h:2391
int as_first_partial_plan
Definition: execnodes.h:1223
bool * relsubs_done
Definition: execnodes.h:1120
struct HashTapeInfo * hash_tapeinfo
Definition: execnodes.h:2206
AggStatePerHash perhash
Definition: execnodes.h:2226
ScanState ss
Definition: execnodes.h:2033
PlanState ps
Definition: execnodes.h:2348
IncrementalSortExecutionStatus execution_status
Definition: execnodes.h:2094
bool outeropsset
Definition: execnodes.h:1022
MergeJoinClause mj_Clauses
Definition: execnodes.h:1909
dsa_pointer tbmiterator
Definition: execnodes.h:1547
Tuplestorestate * buffer
Definition: execnodes.h:2259
int es_instrument
Definition: execnodes.h:579
ExprState * oc_WhereClause
Definition: execnodes.h:387
struct GatherMergeState GatherMergeState
struct ScanKeyData * ioss_OrderByKeys
Definition: execnodes.h:1467
MemoryContext aggcontext
Definition: execnodes.h:2294
ExprState * repeatable
Definition: execnodes.h:1354
Datum * innermost_caseval
Definition: execnodes.h:110
bool iss_RuntimeKeysReady
Definition: execnodes.h:1426
TupleHashTable hashtable
Definition: execnodes.h:1283
PlanState * subplan
Definition: execnodes.h:1655
TupleTableSlot * origslot
Definition: execnodes.h:1102
struct LockRowsState LockRowsState
struct RecursiveUnionState RecursiveUnionState
ResultRelInfo ** es_result_relations
Definition: execnodes.h:547
bool ii_ReadyForInserts
Definition: execnodes.h:172
HashInstrumentation * hinstrument
Definition: execnodes.h:2440
List * hj_HashOperators
Definition: execnodes.h:1962
Bitmapset * grouped_cols
Definition: execnodes.h:2187
struct HashJoinTableData * HashJoinTable
Definition: execnodes.h:1955
ExprState ** ri_ConstraintExprs
Definition: execnodes.h:465
TBMIterateResult * tbmres
Definition: execnodes.h:1587
struct SharedJitInstrumentation * worker_jit_instrument
Definition: execnodes.h:955
bool resultopsset
Definition: execnodes.h:1024
TriggerDesc * ri_TrigDesc
Definition: execnodes.h:427
struct AggState AggState
Index rowmarkId
Definition: execnodes.h:648
TupleHashIterator hashiter
Definition: execnodes.h:2473
int hash_batches_used
Definition: execnodes.h:2224
void * evalfunc_private
Definition: execnodes.h:96
Bitmapset * chgParam
Definition: execnodes.h:973
struct ExprContext_CB * next
Definition: execnodes.h:191
Tuplestorestate * working_table
Definition: execnodes.h:1277
bool rs_checkqual
Definition: execnodes.h:1135
int ri_NumGeneratedNeeded
Definition: execnodes.h:471
void * ii_AmCache
Definition: execnodes.h:177
QueryEnvironment * es_queryEnv
Definition: execnodes.h:569
int hj_CurBucketNo
Definition: execnodes.h:1966
MemoryContext perTableCxt
Definition: execnodes.h:1743
RecursiveUnionState * rustate
Definition: execnodes.h:1799
PlanState ** mt_plans
Definition: execnodes.h:1165
struct FunctionScanPerFuncState * funcstates
Definition: execnodes.h:1684
int num_hashes
Definition: execnodes.h:2204
SetFunctionReturnMode
Definition: execnodes.h:284
int64 spooled_rows
Definition: execnodes.h:2264
OnConflictSetState * ri_onConflict
Definition: execnodes.h:486
bool domainValue_isNull
Definition: execnodes.h:258
bool input_done
Definition: execnodes.h:2182
TupleDesc ps_ResultTupleDesc
Definition: execnodes.h:978
ExprDoneCond
Definition: execnodes.h:271
ProjectionInfo * combinedproj
Definition: execnodes.h:2234
ExprContext * curaggcontext
Definition: execnodes.h:2178
ExprContext * hashcontext
Definition: execnodes.h:2174
bool * ecxt_aggnulls
Definition: execnodes.h:246
bool mj_SkipMarkRestore
Definition: execnodes.h:1911
struct NestLoopState NestLoopState
List * es_trig_target_relations
Definition: execnodes.h:563
Plan * plan
Definition: execnodes.h:1093
List * es_tupleTable
Definition: execnodes.h:574
LockClauseStrength
Definition: lockoptions.h:21
AggStatePerPhase phase
Definition: execnodes.h:2169
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:947
List * es_auxmodifytables
Definition: execnodes.h:586
Datum curArray
Definition: execnodes.h:864
Bitmapset * as_valid_subplans
Definition: execnodes.h:1228
uintptr_t Datum
Definition: postgres.h:367
TupleDesc tupDesc
Definition: execnodes.h:2380
TupleTableSlot * last_slot
Definition: execnodes.h:2527
ExecProcNodeMtd ExecProcNodeReal
Definition: execnodes.h:948
ExprContext * rowcontext
Definition: execnodes.h:1715
IncrementalSortGroupInfo fullsortGroupInfo
Definition: execnodes.h:2061
int ii_NumIndexAttrs
Definition: execnodes.h:157
TupleTableSlot * funnel_slot
Definition: execnodes.h:2353
TupleDesc scandesc
Definition: execnodes.h:988
List * ri_WithCheckOptions
Definition: execnodes.h:459
TupleDesc funcResultDesc
Definition: execnodes.h:817
Expr * expr
Definition: execnodes.h:788
struct TupleHashEntryData * TupleHashEntry
Definition: execnodes.h:694
TupleTableSlot * agg_row_slot
Definition: execnodes.h:2317
TIDBitmap * biss_result
Definition: execnodes.h:1499
List * hj_Collations
Definition: execnodes.h:1963
unsigned int Index
Definition: c.h:549
struct SharedAggInfo SharedAggInfo
Tuplesortstate * fullsort_state
Definition: execnodes.h:2096
struct TupleQueueReader ** reader
Definition: execnodes.h:2389
FmgrInfo * hashfunctions
Definition: execnodes.h:2463
TupleTableSlot * nl_NullInnerTupleSlot
Definition: execnodes.h:1877
FunctionCallInfo fcinfo
Definition: execnodes.h:2013
Plan * plan
Definition: execnodes.h:941
TupleTableSlot * frametail_slot
Definition: execnodes.h:2314
MemoryContext hashtempcxt
Definition: execnodes.h:874
bool more_partitions
Definition: execnodes.h:2302
struct SampleScanState SampleScanState
List * es_tuple_routing_result_relations
Definition: execnodes.h:560
Relation ioss_RelationDesc
Definition: execnodes.h:1473
bool es_finished
Definition: execnodes.h:580
PlanState ps
Definition: execnodes.h:1249
void * ri_FdwState
Definition: execnodes.h:447
ExprState * array_expr
Definition: execnodes.h:1382
int allowedModes
Definition: execnodes.h:304
struct EState EState
TupleTableSlot * oc_ProjSlot
Definition: execnodes.h:385
JoinState js
Definition: execnodes.h:1907
MemoryContext hashtablecxt
Definition: execnodes.h:873
dsa_pointer prefetch_iterator
Definition: execnodes.h:1548
struct binaryheap * ms_heap
Definition: execnodes.h:1255
tuplehash_hash * hashtab
Definition: execnodes.h:715
bool scanopsfixed
Definition: execnodes.h:1017
ScanState ss
Definition: execnodes.h:1417
bool ii_Unique
Definition: execnodes.h:171
struct PlanState PlanState
uint64 hash_disk_used
Definition: execnodes.h:2223
SetFunctionReturnMode returnMode
Definition: execnodes.h:306
ExprContext ** aggcontexts
Definition: execnodes.h:2175
MemoryContext tableContext
Definition: execnodes.h:1284
TupleTableSlot * ecxt_outertuple
Definition: execnodes.h:229
uint32 bits32
Definition: c.h:450
TupleTableSlot * ri_TrigOldSlot
Definition: execnodes.h:440
bool hj_OuterNotEmpty
Definition: execnodes.h:1976
int64 frametailpos
Definition: execnodes.h:2267
List * ii_Expressions
Definition: execnodes.h:160
int ri_BatchSize
Definition: execnodes.h:454
struct IncrementalSortInfo IncrementalSortInfo
NodeTag type
Definition: execnodes.h:156
FmgrInfo * tab_eq_funcs
Definition: execnodes.h:883
TupleTableSlot * tableslot
Definition: execnodes.h:724
TupleTableSlot * mj_InnerTupleSlot
Definition: execnodes.h:1919
struct AggStatePerAggData * AggStatePerAgg
Definition: execnodes.h:2155
FmgrInfo startInRangeFunc
Definition: execnodes.h:2280
FunctionCallInfo fcinfo
Definition: execnodes.h:848
bool grouptail_valid
Definition: execnodes.h:2308
TupleTableSlot * framehead_slot
Definition: execnodes.h:2313
bool setop_done
Definition: execnodes.h:2464
struct UniqueState UniqueState
Relation * es_relations
Definition: execnodes.h:534
FmgrInfo * in_functions
Definition: execnodes.h:1740
Oid * tab_collations
Definition: execnodes.h:881
TupleTableSlot * subSlot
Definition: execnodes.h:2524
RowMarkType markType
Definition: execnodes.h:649
uint64 es_processed
Definition: execnodes.h:576
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:187
int as_whichplan
Definition: execnodes.h:1222
bool hash_ever_spilled
Definition: execnodes.h:2212
#define INDEX_MAX_KEYS
AggStatePerGroup * pergroups
Definition: execnodes.h:2199
int ii_ParallelWorkers
Definition: execnodes.h:175
size_t Size
Definition: c.h:540
AggSplit
Definition: nodes.h:784
bool funcReturnsTuple
Definition: execnodes.h:818
ExprContext * mj_OuterEContext
Definition: execnodes.h:1923
struct ParallelBitmapHeapState ParallelBitmapHeapState
bool randomAccess
Definition: execnodes.h:2034
RowMarkType
Definition: plannodes.h:1036
struct SetOpState SetOpState
SharedBitmapState state
Definition: execnodes.h:1552
bool sort_Done
Definition: execnodes.h:2037
Tuplestorestate * relation
Definition: execnodes.h:1785
ExprState * indexqual
Definition: execnodes.h:1464
TupleTableSlot * ecxt_scantuple
Definition: execnodes.h:225
SetOpStatePerGroup pergroup
Definition: execnodes.h:2467
Index es_range_table_size
Definition: execnodes.h:533
struct PartitionPruneState * ms_prune_state
Definition: execnodes.h:1257
List * es_subplanstates
Definition: execnodes.h:584
struct TsmRoutine * tsmroutine
Definition: execnodes.h:1356
TBMSharedIterator * shared_tbmiterator
Definition: execnodes.h:1600
AttrNumber toidAttNo
Definition: execnodes.h:673
bool outeropsfixed
Definition: execnodes.h:1018
ExprContext * iss_RuntimeContext
Definition: execnodes.h:1427
bool scanopsset
Definition: execnodes.h:1021
TBMIterator * tbmiterator
Definition: execnodes.h:1586
TupleTableSlot * mt_root_tuple_slot
Definition: execnodes.h:1186
PartitionDirectory es_partition_directory
Definition: execnodes.h:554
MemoryContext ecxt_per_query_memory
Definition: execnodes.h:232
Size hash_mem_limit
Definition: execnodes.h:2215
TupleTableSlot * mj_NullOuterTupleSlot
Definition: execnodes.h:1921
int numphases
Definition: execnodes.h:2170
struct IndexInfo IndexInfo
LimitOption
Definition: nodes.h:839
bool ii_Concurrent
Definition: execnodes.h:173
FmgrInfo * lhs_hash_funcs
Definition: execnodes.h:884
int64 currentpos
Definition: execnodes.h:2265
ExprState * qual
Definition: execnodes.h:962
Tuplestorestate * setResult
Definition: execnodes.h:309
FmgrInfo * cur_eq_funcs
Definition: execnodes.h:885
bool setArgsValid
Definition: execnodes.h:833
bool resultopsfixed
Definition: execnodes.h:1020
PlanState * cteplanstate
Definition: execnodes.h:1762
ExprContext * econtext
Definition: execnodes.h:302
struct MergeAppendState MergeAppendState
JoinState js
Definition: execnodes.h:1874
IndexArrayKeyInfo * biss_ArrayKeys
Definition: execnodes.h:1504
int nextreader
Definition: execnodes.h:2358
TupleTableSlot * funcResultSlot
Definition: execnodes.h:811
TupleTableSlot * hj_HashTupleSlot
Definition: execnodes.h:1970
Tuplesortstate * prefixsort_state
Definition: execnodes.h:2097
Definition: dsa.c:354
bool caseValue_isNull
Definition: execnodes.h:252
bool partition_spooled
Definition: execnodes.h:2300
Oid * ii_ExclusionOps
Definition: execnodes.h:164
AggStrategy
Definition: nodes.h:762
struct TidScanState TidScanState
TupleDesc setDesc
Definition: execnodes.h:310
Size hash_mem_peak
Definition: execnodes.h:2220
ConditionVariable cv
Definition: execnodes.h:1553
ExprState * elidedFuncState
Definition: execnodes.h:796
struct ReturnSetInfo ReturnSetInfo
struct ScanKeyData * iss_OrderByKeys
Definition: execnodes.h:1422
int steps_alloc
Definition: execnodes.h:104
struct GatherState GatherState
TupleConversionMap * ri_RootToPartitionMap
Definition: execnodes.h:504
HashJoinTable hj_HashTable
Definition: execnodes.h:1964
int es_top_eflags
Definition: execnodes.h:578
AggStatePerAgg peragg
Definition: execnodes.h:2172
bool framehead_valid
Definition: execnodes.h:2304
int steps_len
Definition: execnodes.h:103
PlanState ** appendplans
Definition: execnodes.h:1220
TBMIterator * prefetch_iterator
Definition: execnodes.h:1594
SharedAggInfo * shared_info
Definition: execnodes.h:2235
TupleDesc descRight
Definition: execnodes.h:866
struct DomainConstraintState DomainConstraintState
IndexInfo ** ri_IndexRelationInfo
Definition: execnodes.h:424
List * lr_arowMarks
Definition: execnodes.h:2485
struct ExprContext_CB ExprContext_CB
NodeTag type
Definition: execnodes.h:857
struct JunkFilter JunkFilter
struct ScanKeyData * iss_ScanKeys
Definition: execnodes.h:1420
ExprDoneCond * elemdone
Definition: execnodes.h:1149
uint64 hash_ngroups_current
Definition: execnodes.h:2221
uint8 flags
Definition: execnodes.h:64
NodeTag type
Definition: execnodes.h:526
ExprState pi_state
Definition: execnodes.h:332
void * arg
AggStatePerTrans curpertrans
Definition: execnodes.h:2181
int epqParam
Definition: execnodes.h:1078
ParamListInfo es_param_list_info
Definition: execnodes.h:566
List * es_exprcontexts
Definition: execnodes.h:582
MemoryContext tempcxt
Definition: execnodes.h:722
ProjectionInfo * projRight
Definition: execnodes.h:868
MemoryContext partcontext
Definition: execnodes.h:2293
struct CteScanState CteScanState
TupleTableSlot * group_pivot
Definition: execnodes.h:2104
ExprDoneCond isDone
Definition: execnodes.h:307
struct ResultState ResultState
WindowFunc * wfunc
Definition: execnodes.h:769
List * aggs
Definition: execnodes.h:2164
ExprContext * biss_RuntimeContext
Definition: execnodes.h:1507
bool mj_ExtraMarks
Definition: execnodes.h:1912
Datum * iss_OrderByValues
Definition: execnodes.h:1434
uint16 * ii_ExclusionStrats
Definition: execnodes.h:166
struct BitmapIndexScanState BitmapIndexScanState
ParamListInfo ecxt_param_list_info
Definition: execnodes.h:237
int iss_NumOrderByKeys
Definition: execnodes.h:1423
Tuplestorestate * cte_table
Definition: execnodes.h:1766
List ** exprlists
Definition: execnodes.h:1716
ExprContext * pi_exprContext
Definition: execnodes.h:334
struct SortState SortState
ExecAuxRowMark ** relsubs_rowmark
Definition: execnodes.h:1114
SharedIncrementalSortInfo * shared_info
Definition: execnodes.h:2107
Definition: pg_list.h:50
Tuplestorestate * tupstore
Definition: execnodes.h:1744
int Buffer
Definition: buf.h:23
bool havehashrows
Definition: execnodes.h:871
Datum resvalue
Definition: execnodes.h:73
int16 AttrNumber
Definition: attnum.h:21
ExprState * rowexpr
Definition: execnodes.h:1732
JoinState js
Definition: execnodes.h:1959
struct IndexScanDescData * iss_ScanDesc
Definition: execnodes.h:1429
struct IndexOnlyScanState IndexOnlyScanState
LockWaitPolicy
Definition: lockoptions.h:36
List * ri_onConflictArbiterIndexes
Definition: execnodes.h:483
CmdType
Definition: nodes.h:676
TupleHashTable hashnulls
Definition: execnodes.h:870
AttrNumber ctidAttNo
Definition: execnodes.h:672
Datum * ii_OpclassOptions
Definition: execnodes.h:170
TupleTableSlot * transfer_tuple
Definition: execnodes.h:2105
RelationPtr ri_IndexRelationDescs
Definition: execnodes.h:421
PlanState ps
Definition: execnodes.h:2515
struct SubPlanState SubPlanState
TBMSharedIterator * shared_prefetch_iterator
Definition: execnodes.h:1601
struct IndexScanState IndexScanState
TupleHashTable hashtable
Definition: execnodes.h:2470
ExprState * hashclauses
Definition: execnodes.h:1960
List * ri_returningList
Definition: execnodes.h:477
TupleTableSlot * hash_spill_wslot
Definition: execnodes.h:2210
FmgrInfo * ri_TrigFunctions
Definition: execnodes.h:430
struct ForeignScanState ForeignScanState
struct BitmapOrState BitmapOrState
Relation iss_RelationDesc
Definition: execnodes.h:1428
List ** mt_arowmarks
Definition: execnodes.h:1178
TupleTableSlot * mj_OuterTupleSlot
Definition: execnodes.h:1918
PlanState * recheckplanstate
Definition: execnodes.h:1122
SortSupport gm_sortkeys
Definition: execnodes.h:2382
pairingheap * iss_ReorderQueue
Definition: execnodes.h:1432
const TupleTableSlotOps * outerops
Definition: execnodes.h:1014
unsigned char bool
Definition: c.h:391
struct SharedHashInfo SharedHashInfo
struct LimitState LimitState
int64 tuples_needed
Definition: execnodes.h:2351
AggStatePerGroup * all_pergroups
Definition: execnodes.h:2232
struct WorkTableScanState WorkTableScanState
struct JoinState JoinState
Oid ii_Am
Definition: execnodes.h:176
PlanState ps
Definition: execnodes.h:1132
ScanState ss
Definition: execnodes.h:1352