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