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