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