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