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