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