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