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