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