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