Thanks to visit codestin.com
Credit goes to doxygen.postgresql.org

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
847typedef struct TupleHashEntryData
848{
849 MinimalTuple firstTuple; /* copy of first tuple in this group */
850 uint32 status; /* hash status */
851 uint32 hash; /* hash value (cached) */
853
854/* define parameters necessary to generate the tuple hash table interface */
855#define SH_PREFIX tuplehash
856#define SH_ELEMENT_TYPE TupleHashEntryData
857#define SH_KEY_TYPE MinimalTuple
858#define SH_SCOPE extern
859#define SH_DECLARE
860#include "lib/simplehash.h"
861
862typedef struct TupleHashTableData
863{
864 tuplehash_hash *hashtab; /* underlying hash table */
865 int numCols; /* number of columns in lookup key */
866 AttrNumber *keyColIdx; /* attr numbers of key columns */
867 ExprState *tab_hash_expr; /* ExprState for hashing table datatype(s) */
868 ExprState *tab_eq_func; /* comparator for table datatype(s) */
869 Oid *tab_collations; /* collations for hash and comparison */
870 MemoryContext tablecxt; /* memory context containing table */
871 MemoryContext tempcxt; /* context for function evaluations */
872 Size additionalsize; /* size of additional data */
873 TupleTableSlot *tableslot; /* slot for referencing table entries */
874 /* The following fields are set transiently for each table search: */
875 TupleTableSlot *inputslot; /* current input tuple's slot */
876 ExprState *in_hash_expr; /* ExprState for hashing input datatype(s) */
877 ExprState *cur_eq_func; /* comparator for input vs. table */
878 ExprContext *exprcontext; /* expression context */
880
881typedef tuplehash_iterator TupleHashIterator;
882
883/*
884 * Use InitTupleHashIterator/TermTupleHashIterator for a read/write scan.
885 * Use ResetTupleHashIterator if the table can be frozen (in this case no
886 * explicit scan termination is needed).
887 */
888#define InitTupleHashIterator(htable, iter) \
889 tuplehash_start_iterate(htable->hashtab, iter)
890#define TermTupleHashIterator(iter) \
891 ((void) 0)
892#define ResetTupleHashIterator(htable, iter) \
893 InitTupleHashIterator(htable, iter)
894#define ScanTupleHashTable(htable, iter) \
895 tuplehash_iterate(htable->hashtab, iter)
896
897
898/* ----------------------------------------------------------------
899 * Expression State Nodes
900 *
901 * Formerly, there was a separate executor expression state node corresponding
902 * to each node in a planned expression tree. That's no longer the case; for
903 * common expression node types, all the execution info is embedded into
904 * step(s) in a single ExprState node. But we still have a few executor state
905 * node types for selected expression node types, mostly those in which info
906 * has to be shared with other parts of the execution state tree.
907 * ----------------------------------------------------------------
908 */
909
910/* ----------------
911 * WindowFuncExprState node
912 * ----------------
913 */
915{
917 WindowFunc *wfunc; /* expression plan node */
918 List *args; /* ExprStates for argument expressions */
919 ExprState *aggfilter; /* FILTER expression */
920 int wfuncno; /* ID number for wfunc within its plan node */
922
923
924/* ----------------
925 * SetExprState node
926 *
927 * State for evaluating a potentially set-returning expression (like FuncExpr
928 * or OpExpr). In some cases, like some of the expressions in ROWS FROM(...)
929 * the expression might not be a SRF, but nonetheless it uses the same
930 * machinery as SRFs; it will be treated as a SRF returning a single row.
931 * ----------------
932 */
933typedef struct SetExprState
934{
936 Expr *expr; /* expression plan node */
937 List *args; /* ExprStates for argument expressions */
938
939 /*
940 * In ROWS FROM, functions can be inlined, removing the FuncExpr normally
941 * inside. In such a case this is the compiled expression (which cannot
942 * return a set), which'll be evaluated using regular ExecEvalExpr().
943 */
945
946 /*
947 * Function manager's lookup info for the target function. If func.fn_oid
948 * is InvalidOid, we haven't initialized it yet (nor any of the following
949 * fields, except funcReturnsSet).
950 */
952
953 /*
954 * For a set-returning function (SRF) that returns a tuplestore, we keep
955 * the tuplestore here and dole out the result rows one at a time. The
956 * slot holds the row currently being returned.
957 */
960
961 /*
962 * In some cases we need to compute a tuple descriptor for the function's
963 * output. If so, it's stored here.
964 */
966 bool funcReturnsTuple; /* valid when funcResultDesc isn't NULL */
967
968 /*
969 * Remember whether the function is declared to return a set. This is set
970 * by ExecInitExpr, and is valid even before the FmgrInfo is set up.
971 */
973
974 /*
975 * setArgsValid is true when we are evaluating a set-returning function
976 * that uses value-per-call mode and we are in the middle of a call
977 * series; we want to pass the same argument values to the function again
978 * (and again, until it returns ExprEndResult). This indicates that
979 * fcinfo_data already contains valid argument data.
980 */
982
983 /*
984 * Flag to remember whether we have registered a shutdown callback for
985 * this SetExprState. We do so only if funcResultStore or setArgsValid
986 * has been set at least once (since all the callback is for is to release
987 * the tuplestore or clear setArgsValid).
988 */
989 bool shutdown_reg; /* a shutdown callback is registered */
990
991 /*
992 * Call parameter structure for the function. This has been initialized
993 * (by InitFunctionCallInfoData) if func.fn_oid is valid. It also saves
994 * argument values between calls, when setArgsValid is true.
995 */
998
999/* ----------------
1000 * SubPlanState node
1001 * ----------------
1002 */
1003typedef struct SubPlanState
1004{
1006 SubPlan *subplan; /* expression plan node */
1007 PlanState *planstate; /* subselect plan's state tree */
1008 PlanState *parent; /* parent plan node's state tree */
1009 ExprState *testexpr; /* state of combining expression */
1010 HeapTuple curTuple; /* copy of most recent tuple from subplan */
1011 Datum curArray; /* most recent array from ARRAY() subplan */
1012 /* these are used when hashing the subselect's output: */
1013 TupleDesc descRight; /* subselect desc after projection */
1014 ProjectionInfo *projLeft; /* for projecting lefthand exprs */
1015 ProjectionInfo *projRight; /* for projecting subselect output */
1016 TupleHashTable hashtable; /* hash table for no-nulls subselect rows */
1017 TupleHashTable hashnulls; /* hash table for rows with null(s) */
1018 bool havehashrows; /* true if hashtable is not empty */
1019 bool havenullrows; /* true if hashnulls is not empty */
1020 MemoryContext hashtablecxt; /* memory context containing hash tables */
1021 ExprContext *innerecontext; /* econtext for computing inner tuples */
1022 int numCols; /* number of columns being hashed */
1023 /* each of the remaining fields is an array of length numCols: */
1024 AttrNumber *keyColIdx; /* control data for hash tables */
1025 Oid *tab_eq_funcoids; /* equality func oids for table
1026 * datatype(s) */
1027 Oid *tab_collations; /* collations for hash and comparison */
1028 FmgrInfo *tab_hash_funcs; /* hash functions for table datatype(s) */
1029 ExprState *lhs_hash_expr; /* hash expr for lefthand datatype(s) */
1030 FmgrInfo *cur_eq_funcs; /* equality functions for LHS vs. table */
1031 ExprState *cur_eq_comp; /* equality comparator for LHS vs. table */
1033
1034/*
1035 * DomainConstraintState - one item to check during CoerceToDomain
1036 *
1037 * Note: we consider this to be part of an ExprState tree, so we give it
1038 * a name following the xxxState convention. But there's no directly
1039 * associated plan-tree node.
1040 */
1042{
1046
1048{
1051 char *name; /* name of constraint (for error msgs) */
1052 Expr *check_expr; /* for CHECK, a boolean expression */
1053 ExprState *check_exprstate; /* check_expr's eval state, or NULL */
1055
1056/*
1057 * State for JsonExpr evaluation, too big to inline.
1058 *
1059 * This contains the information going into and coming out of the
1060 * EEOP_JSONEXPR_PATH eval step.
1061 */
1062typedef struct JsonExprState
1063{
1064 /* original expression node */
1066
1067 /* value/isnull for formatted_expr */
1069
1070 /* value/isnull for pathspec */
1072
1073 /* JsonPathVariable entries for passing_values */
1075
1076 /*
1077 * Output variables that drive the EEOP_JUMP_IF_NOT_TRUE steps that are
1078 * added for ON ERROR and ON EMPTY expressions, if any.
1079 *
1080 * Reset for each evaluation of EEOP_JSONEXPR_PATH.
1081 */
1082
1083 /* Set to true if jsonpath evaluation cause an error. */
1085
1086 /* Set to true if the jsonpath evaluation returned 0 items. */
1088
1089 /*
1090 * Addresses of steps that implement the non-ERROR variant of ON EMPTY and
1091 * ON ERROR behaviors, respectively.
1092 */
1095
1096 /*
1097 * Address of the step to coerce the result value of jsonpath evaluation
1098 * to the RETURNING type. -1 if no coercion if JsonExpr.use_io_coercion
1099 * is true.
1100 */
1102
1103 /*
1104 * Address to jump to when skipping all the steps after performing
1105 * ExecEvalJsonExprPath() so as to return whatever the JsonPath* function
1106 * returned as is, that is, in the cases where there's no error and no
1107 * coercion is necessary.
1108 */
1110
1111 /*
1112 * RETURNING type input function invocation info when
1113 * JsonExpr.use_io_coercion is true.
1114 */
1116
1117 /*
1118 * For error-safe evaluation of coercions. When the ON ERROR behavior is
1119 * not ERROR, a pointer to this is passed to ExecInitExprRec() when
1120 * initializing the coercion expressions or to ExecInitJsonCoercion().
1121 *
1122 * Reset for each evaluation of EEOP_JSONEXPR_PATH.
1123 */
1126
1127
1128/* ----------------------------------------------------------------
1129 * Executor State Trees
1130 *
1131 * An executing query has a PlanState tree paralleling the Plan tree
1132 * that describes the plan.
1133 * ----------------------------------------------------------------
1134 */
1135
1136/* ----------------
1137 * ExecProcNodeMtd
1138 *
1139 * This is the method called by ExecProcNode to return the next tuple
1140 * from an executor node. It returns NULL, or an empty TupleTableSlot,
1141 * if no more tuples are available.
1142 * ----------------
1143 */
1144typedef TupleTableSlot *(*ExecProcNodeMtd) (PlanState *pstate);
1145
1146/* ----------------
1147 * PlanState node
1148 *
1149 * We never actually instantiate any PlanState nodes; this is just the common
1150 * abstract superclass for all PlanState-type nodes.
1151 * ----------------
1152 */
1153typedef struct PlanState
1154{
1156
1157 NodeTag type;
1158
1159 Plan *plan; /* associated Plan node */
1160
1161 EState *state; /* at execution time, states of individual
1162 * nodes point to one EState for the whole
1163 * top-level plan */
1164
1165 ExecProcNodeMtd ExecProcNode; /* function to return next tuple */
1166 ExecProcNodeMtd ExecProcNodeReal; /* actual function, if above is a
1167 * wrapper */
1168
1169 Instrumentation *instrument; /* Optional runtime stats for this node */
1170 WorkerInstrumentation *worker_instrument; /* per-worker instrumentation */
1171
1172 /* Per-worker JIT instrumentation */
1174
1175 /*
1176 * Common structural data for all Plan types. These links to subsidiary
1177 * state trees parallel links in the associated plan tree (except for the
1178 * subPlan list, which does not exist in the plan tree).
1179 */
1180 ExprState *qual; /* boolean qual condition */
1181 PlanState *lefttree; /* input plan tree(s) */
1183
1184 List *initPlan; /* Init SubPlanState nodes (un-correlated expr
1185 * subselects) */
1186 List *subPlan; /* SubPlanState nodes in my expressions */
1187
1188 /*
1189 * State for management of parameter-change-driven rescanning
1190 */
1191 Bitmapset *chgParam; /* set of IDs of changed Params */
1192
1193 /*
1194 * Other run-time state needed by most if not all node types.
1195 */
1196 TupleDesc ps_ResultTupleDesc; /* node's return type */
1197 TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */
1198 ExprContext *ps_ExprContext; /* node's expression-evaluation context */
1199 ProjectionInfo *ps_ProjInfo; /* info for doing tuple projection */
1200
1201 bool async_capable; /* true if node is async-capable */
1202
1203 /*
1204 * Scanslot's descriptor if known. This is a bit of a hack, but otherwise
1205 * it's hard for expression compilation to optimize based on the
1206 * descriptor, without encoding knowledge about all executor nodes.
1207 */
1209
1210 /*
1211 * Define the slot types for inner, outer and scanslots for expression
1212 * contexts with this state as a parent. If *opsset is set, then
1213 * *opsfixed indicates whether *ops is guaranteed to be the type of slot
1214 * used. That means that every slot in the corresponding
1215 * ExprContext.ecxt_*tuple will point to a slot of that type, while
1216 * evaluating the expression. If *opsfixed is false, but *ops is set,
1217 * that indicates the most likely type of slot.
1218 *
1219 * The scan* fields are set by ExecInitScanTupleSlot(). If that's not
1220 * called, nodes can initialize the fields themselves.
1221 *
1222 * If outer/inneropsset is false, the information is inferred on-demand
1223 * using ExecGetResultSlotOps() on ->righttree/lefttree, using the
1224 * corresponding node's resultops* fields.
1225 *
1226 * The result* fields are automatically set when ExecInitResultSlot is
1227 * used (be it directly or when the slot is created by
1228 * ExecAssignScanProjectionInfo() /
1229 * ExecConditionalAssignProjectionInfo()). If no projection is necessary
1230 * ExecConditionalAssignProjectionInfo() defaults those fields to the scan
1231 * operations.
1232 */
1245} PlanState;
1246
1247/* ----------------
1248 * these are defined to avoid confusion problems with "left"
1249 * and "right" and "inner" and "outer". The convention is that
1250 * the "left" plan is the "outer" plan and the "right" plan is
1251 * the inner plan, but these make the code more readable.
1252 * ----------------
1253 */
1254#define innerPlanState(node) (((PlanState *)(node))->righttree)
1255#define outerPlanState(node) (((PlanState *)(node))->lefttree)
1256
1257/* Macros for inline access to certain instrumentation counters */
1258#define InstrCountTuples2(node, delta) \
1259 do { \
1260 if (((PlanState *)(node))->instrument) \
1261 ((PlanState *)(node))->instrument->ntuples2 += (delta); \
1262 } while (0)
1263#define InstrCountFiltered1(node, delta) \
1264 do { \
1265 if (((PlanState *)(node))->instrument) \
1266 ((PlanState *)(node))->instrument->nfiltered1 += (delta); \
1267 } while(0)
1268#define InstrCountFiltered2(node, delta) \
1269 do { \
1270 if (((PlanState *)(node))->instrument) \
1271 ((PlanState *)(node))->instrument->nfiltered2 += (delta); \
1272 } while(0)
1273
1274/*
1275 * EPQState is state for executing an EvalPlanQual recheck on a candidate
1276 * tuples e.g. in ModifyTable or LockRows.
1277 *
1278 * To execute EPQ a separate EState is created (stored in ->recheckestate),
1279 * which shares some resources, like the rangetable, with the main query's
1280 * EState (stored in ->parentestate). The (sub-)tree of the plan that needs to
1281 * be rechecked (in ->plan), is separately initialized (into
1282 * ->recheckplanstate), but shares plan nodes with the corresponding nodes in
1283 * the main query. The scan nodes in that separate executor tree are changed
1284 * to return only the current tuple of interest for the respective
1285 * table. Those tuples are either provided by the caller (using
1286 * EvalPlanQualSlot), and/or found using the rowmark mechanism (non-locking
1287 * rowmarks by the EPQ machinery itself, locking ones by the caller).
1288 *
1289 * While the plan to be checked may be changed using EvalPlanQualSetPlan(),
1290 * all such plans need to share the same EState.
1291 */
1292typedef struct EPQState
1293{
1294 /* These are initialized by EvalPlanQualInit() and do not change later: */
1295 EState *parentestate; /* main query's EState */
1296 int epqParam; /* ID of Param to force scan node re-eval */
1297 List *resultRelations; /* integer list of RT indexes, or NIL */
1298
1299 /*
1300 * relsubs_slot[scanrelid - 1] holds the EPQ test tuple to be returned by
1301 * the scan node for the scanrelid'th RT index, in place of performing an
1302 * actual table scan. Callers should use EvalPlanQualSlot() to fetch
1303 * these slots.
1304 */
1305 List *tuple_table; /* tuple table for relsubs_slot */
1307
1308 /*
1309 * Initialized by EvalPlanQualInit(), may be changed later with
1310 * EvalPlanQualSetPlan():
1311 */
1312
1313 Plan *plan; /* plan tree to be executed */
1314 List *arowMarks; /* ExecAuxRowMarks (non-locking only) */
1315
1316
1317 /*
1318 * The original output tuple to be rechecked. Set by
1319 * EvalPlanQualSetSlot(), before EvalPlanQualNext() or EvalPlanQual() may
1320 * be called.
1321 */
1323
1324
1325 /* Initialized or reset by EvalPlanQualBegin(): */
1326
1327 EState *recheckestate; /* EState for EPQ execution, see above */
1328
1329 /*
1330 * Rowmarks that can be fetched on-demand using
1331 * EvalPlanQualFetchRowMark(), indexed by scanrelid - 1. Only non-locking
1332 * rowmarks.
1333 */
1335
1336 /*
1337 * relsubs_done[scanrelid - 1] is true if there is no EPQ tuple for this
1338 * target relation or it has already been fetched in the current scan of
1339 * this target relation within the current EvalPlanQual test.
1340 */
1342
1343 /*
1344 * relsubs_blocked[scanrelid - 1] is true if there is no EPQ tuple for
1345 * this target relation during the current EvalPlanQual test. We keep
1346 * these flags set for all relids listed in resultRelations, but
1347 * transiently clear the one for the relation whose tuple is actually
1348 * passed to EvalPlanQual().
1349 */
1351
1352 PlanState *recheckplanstate; /* EPQ specific exec nodes, for ->plan */
1354
1355
1356/* ----------------
1357 * ResultState information
1358 * ----------------
1359 */
1360typedef struct ResultState
1361{
1362 PlanState ps; /* its first field is NodeTag */
1364 bool rs_done; /* are we done? */
1365 bool rs_checkqual; /* do we need to check the qual? */
1367
1368/* ----------------
1369 * ProjectSetState information
1370 *
1371 * Note: at least one of the "elems" will be a SetExprState; the rest are
1372 * regular ExprStates.
1373 * ----------------
1374 */
1375typedef struct ProjectSetState
1376{
1377 PlanState ps; /* its first field is NodeTag */
1378 Node **elems; /* array of expression states */
1379 ExprDoneCond *elemdone; /* array of per-SRF is-done states */
1380 int nelems; /* length of elemdone[] array */
1381 bool pending_srf_tuples; /* still evaluating srfs in tlist? */
1382 MemoryContext argcontext; /* context for SRF arguments */
1384
1385
1386/* flags for mt_merge_subcommands */
1387#define MERGE_INSERT 0x01
1388#define MERGE_UPDATE 0x02
1389#define MERGE_DELETE 0x04
1390
1391/* ----------------
1392 * ModifyTableState information
1393 * ----------------
1394 */
1395typedef struct ModifyTableState
1396{
1397 PlanState ps; /* its first field is NodeTag */
1398 CmdType operation; /* INSERT, UPDATE, DELETE, or MERGE */
1399 bool canSetTag; /* do we set the command tag/es_processed? */
1400 bool mt_done; /* are we done? */
1401 int mt_nrels; /* number of entries in resultRelInfo[] */
1402 ResultRelInfo *resultRelInfo; /* info about target relation(s) */
1403
1404 /*
1405 * Target relation mentioned in the original statement, used to fire
1406 * statement-level triggers and as the root for tuple routing. (This
1407 * might point to one of the resultRelInfo[] entries, but it can also be a
1408 * distinct struct.)
1409 */
1411
1412 EPQState mt_epqstate; /* for evaluating EvalPlanQual rechecks */
1413 bool fireBSTriggers; /* do we need to fire stmt triggers? */
1414
1415 /*
1416 * These fields are used for inherited UPDATE and DELETE, to track which
1417 * target relation a given tuple is from. If there are a lot of target
1418 * relations, we use a hash table to translate table OIDs to
1419 * resultRelInfo[] indexes; otherwise mt_resultOidHash is NULL.
1420 */
1421 int mt_resultOidAttno; /* resno of "tableoid" junk attr */
1422 Oid mt_lastResultOid; /* last-seen value of tableoid */
1423 int mt_lastResultIndex; /* corresponding index in resultRelInfo[] */
1424 HTAB *mt_resultOidHash; /* optional hash table to speed lookups */
1425
1426 /*
1427 * Slot for storing tuples in the root partitioned table's rowtype during
1428 * an UPDATE of a partitioned table.
1429 */
1431
1432 /* Tuple-routing support info */
1434
1435 /* controls transition table population for specified operation */
1437
1438 /* controls transition table population for INSERT...ON CONFLICT UPDATE */
1440
1441 /* Flags showing which subcommands are present INS/UPD/DEL/DO NOTHING */
1443
1444 /* For MERGE, the action currently being executed */
1446
1447 /*
1448 * For MERGE, if there is a pending NOT MATCHED [BY TARGET] action to be
1449 * performed, this will be the last tuple read from the subplan; otherwise
1450 * it will be NULL --- see the comments in ExecMerge().
1451 */
1453
1454 /* tuple counters for MERGE */
1458
1459 /*
1460 * Lists of valid updateColnosLists, mergeActionLists, and
1461 * mergeJoinConditions. These contain only entries for unpruned
1462 * relations, filtered from the corresponding lists in ModifyTable.
1463 */
1468
1469/* ----------------
1470 * AppendState information
1471 *
1472 * nplans how many plans are in the array
1473 * whichplan which synchronous plan is being executed (0 .. n-1)
1474 * or a special negative value. See nodeAppend.c.
1475 * prune_state details required to allow partitions to be
1476 * eliminated from the scan, or NULL if not possible.
1477 * valid_subplans for runtime pruning, valid synchronous appendplans
1478 * indexes to scan.
1479 * ----------------
1480 */
1481
1482struct AppendState;
1484struct ParallelAppendState;
1486struct PartitionPruneState;
1487
1489{
1490 PlanState ps; /* its first field is NodeTag */
1491 PlanState **appendplans; /* array of PlanStates for my inputs */
1494 bool as_begun; /* false means need to initialize */
1495 Bitmapset *as_asyncplans; /* asynchronous plans indexes */
1496 int as_nasyncplans; /* # of asynchronous plans */
1497 AsyncRequest **as_asyncrequests; /* array of AsyncRequests */
1498 TupleTableSlot **as_asyncresults; /* unreturned results of async plans */
1499 int as_nasyncresults; /* # of valid entries in as_asyncresults */
1500 bool as_syncdone; /* true if all synchronous plans done in
1501 * asynchronous mode, else false */
1502 int as_nasyncremain; /* # of remaining asynchronous plans */
1503 Bitmapset *as_needrequest; /* asynchronous plans needing a new request */
1504 struct WaitEventSet *as_eventset; /* WaitEventSet used to configure file
1505 * descriptor wait events */
1506 int as_first_partial_plan; /* Index of 'appendplans' containing
1507 * the first partial plan */
1508 ParallelAppendState *as_pstate; /* parallel coordination info */
1509 Size pstate_len; /* size of parallel coordination info */
1511 bool as_valid_subplans_identified; /* is as_valid_subplans valid? */
1513 Bitmapset *as_valid_asyncplans; /* valid asynchronous plans indexes */
1515};
1516
1517/* ----------------
1518 * MergeAppendState information
1519 *
1520 * nplans how many plans are in the array
1521 * nkeys number of sort key columns
1522 * sortkeys sort keys in SortSupport representation
1523 * slots current output tuple of each subplan
1524 * heap heap of active tuples
1525 * initialized true if we have fetched first tuple from each subplan
1526 * prune_state details required to allow partitions to be
1527 * eliminated from the scan, or NULL if not possible.
1528 * valid_subplans for runtime pruning, valid mergeplans indexes to
1529 * scan.
1530 * ----------------
1531 */
1532typedef struct MergeAppendState
1533{
1534 PlanState ps; /* its first field is NodeTag */
1535 PlanState **mergeplans; /* array of PlanStates for my inputs */
1538 SortSupport ms_sortkeys; /* array of length ms_nkeys */
1539 TupleTableSlot **ms_slots; /* array of length ms_nplans */
1540 struct binaryheap *ms_heap; /* binary heap of slot indices */
1541 bool ms_initialized; /* are subplans started? */
1545
1546/* ----------------
1547 * RecursiveUnionState information
1548 *
1549 * RecursiveUnionState is used for performing a recursive union.
1550 *
1551 * recursing T when we're done scanning the non-recursive term
1552 * intermediate_empty T if intermediate_table is currently empty
1553 * working_table working table (to be scanned by recursive term)
1554 * intermediate_table current recursive output (next generation of WT)
1555 * ----------------
1556 */
1558{
1559 PlanState ps; /* its first field is NodeTag */
1564 /* Remaining fields are unused in UNION ALL case */
1565 Oid *eqfuncoids; /* per-grouping-field equality fns */
1566 FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
1567 MemoryContext tempContext; /* short-term context for comparisons */
1568 TupleHashTable hashtable; /* hash table for tuples already seen */
1569 MemoryContext tableContext; /* memory context containing hash table */
1571
1572/* ----------------
1573 * BitmapAndState information
1574 * ----------------
1575 */
1576typedef struct BitmapAndState
1577{
1578 PlanState ps; /* its first field is NodeTag */
1579 PlanState **bitmapplans; /* array of PlanStates for my inputs */
1580 int nplans; /* number of input plans */
1582
1583/* ----------------
1584 * BitmapOrState information
1585 * ----------------
1586 */
1587typedef struct BitmapOrState
1588{
1589 PlanState ps; /* its first field is NodeTag */
1590 PlanState **bitmapplans; /* array of PlanStates for my inputs */
1591 int nplans; /* number of input plans */
1593
1594/* ----------------------------------------------------------------
1595 * Scan State Information
1596 * ----------------------------------------------------------------
1597 */
1598
1599/* ----------------
1600 * ScanState information
1601 *
1602 * ScanState extends PlanState for node types that represent
1603 * scans of an underlying relation. It can also be used for nodes
1604 * that scan the output of an underlying plan node --- in that case,
1605 * only ScanTupleSlot is actually useful, and it refers to the tuple
1606 * retrieved from the subplan.
1607 *
1608 * currentRelation relation being scanned (NULL if none)
1609 * currentScanDesc current scan descriptor for scan (NULL if none)
1610 * ScanTupleSlot pointer to slot in tuple table holding scan tuple
1611 * ----------------
1612 */
1613typedef struct ScanState
1614{
1615 PlanState ps; /* its first field is NodeTag */
1620
1621/* ----------------
1622 * SeqScanState information
1623 * ----------------
1624 */
1625typedef struct SeqScanState
1626{
1627 ScanState ss; /* its first field is NodeTag */
1628 Size pscan_len; /* size of parallel heap scan descriptor */
1630
1631/* ----------------
1632 * SampleScanState information
1633 * ----------------
1634 */
1635typedef struct SampleScanState
1636{
1638 List *args; /* expr states for TABLESAMPLE params */
1639 ExprState *repeatable; /* expr state for REPEATABLE expr */
1640 /* use struct pointer to avoid including tsmapi.h here */
1641 struct TsmRoutine *tsmroutine; /* descriptor for tablesample method */
1642 void *tsm_state; /* tablesample method can keep state here */
1643 bool use_bulkread; /* use bulkread buffer access strategy? */
1644 bool use_pagemode; /* use page-at-a-time visibility checking? */
1645 bool begun; /* false means need to call BeginSampleScan */
1646 uint32 seed; /* random seed */
1647 int64 donetuples; /* number of tuples already returned */
1648 bool haveblock; /* has a block for sampling been determined */
1649 bool done; /* exhausted all tuples? */
1651
1652/*
1653 * These structs store information about index quals that don't have simple
1654 * constant right-hand sides. See comments for ExecIndexBuildScanKeys()
1655 * for discussion.
1656 */
1657typedef struct
1658{
1659 ScanKeyData *scan_key; /* scankey to put value into */
1660 ExprState *key_expr; /* expr to evaluate to get value */
1661 bool key_toastable; /* is expr's result a toastable datatype? */
1663
1664typedef struct
1665{
1666 ScanKeyData *scan_key; /* scankey to put value into */
1667 ExprState *array_expr; /* expr to evaluate to get array value */
1668 int next_elem; /* next array element to use */
1669 int num_elems; /* number of elems in current array value */
1670 Datum *elem_values; /* array of num_elems Datums */
1671 bool *elem_nulls; /* array of num_elems is-null flags */
1673
1674/* ----------------
1675 * IndexScanState information
1676 *
1677 * indexqualorig execution state for indexqualorig expressions
1678 * indexorderbyorig execution state for indexorderbyorig expressions
1679 * ScanKeys Skey structures for index quals
1680 * NumScanKeys number of ScanKeys
1681 * OrderByKeys Skey structures for index ordering operators
1682 * NumOrderByKeys number of OrderByKeys
1683 * RuntimeKeys info about Skeys that must be evaluated at runtime
1684 * NumRuntimeKeys number of RuntimeKeys
1685 * RuntimeKeysReady true if runtime Skeys have been computed
1686 * RuntimeContext expr context for evaling runtime Skeys
1687 * RelationDesc index relation descriptor
1688 * ScanDesc index scan descriptor
1689 * Instrument local index scan instrumentation
1690 * SharedInfo parallel worker instrumentation (no leader entry)
1691 *
1692 * ReorderQueue tuples that need reordering due to re-check
1693 * ReachedEnd have we fetched all tuples from index already?
1694 * OrderByValues values of ORDER BY exprs of last fetched tuple
1695 * OrderByNulls null flags for OrderByValues
1696 * SortSupport for reordering ORDER BY exprs
1697 * OrderByTypByVals is the datatype of order by expression pass-by-value?
1698 * OrderByTypLens typlens of the datatypes of order by expressions
1699 * PscanLen size of parallel index scan descriptor
1700 * ----------------
1701 */
1702typedef struct IndexScanState
1703{
1704 ScanState ss; /* its first field is NodeTag */
1719
1720 /* These are needed for re-checking ORDER BY expr ordering */
1730
1731/* ----------------
1732 * IndexOnlyScanState information
1733 *
1734 * recheckqual execution state for recheckqual expressions
1735 * ScanKeys Skey structures for index quals
1736 * NumScanKeys number of ScanKeys
1737 * OrderByKeys Skey structures for index ordering operators
1738 * NumOrderByKeys number of OrderByKeys
1739 * RuntimeKeys info about Skeys that must be evaluated at runtime
1740 * NumRuntimeKeys number of RuntimeKeys
1741 * RuntimeKeysReady true if runtime Skeys have been computed
1742 * RuntimeContext expr context for evaling runtime Skeys
1743 * RelationDesc index relation descriptor
1744 * ScanDesc index scan descriptor
1745 * Instrument local index scan instrumentation
1746 * SharedInfo parallel worker instrumentation (no leader entry)
1747 * TableSlot slot for holding tuples fetched from the table
1748 * VMBuffer buffer in use for visibility map testing, if any
1749 * PscanLen size of parallel index-only scan descriptor
1750 * NameCStringAttNums attnums of name typed columns to pad to NAMEDATALEN
1751 * NameCStringCount number of elements in the NameCStringAttNums array
1752 * ----------------
1753 */
1755{
1756 ScanState ss; /* its first field is NodeTag */
1776
1777/* ----------------
1778 * BitmapIndexScanState information
1779 *
1780 * result bitmap to return output into, or NULL
1781 * ScanKeys Skey structures for index quals
1782 * NumScanKeys number of ScanKeys
1783 * RuntimeKeys info about Skeys that must be evaluated at runtime
1784 * NumRuntimeKeys number of RuntimeKeys
1785 * ArrayKeys info about Skeys that come from ScalarArrayOpExprs
1786 * NumArrayKeys number of ArrayKeys
1787 * RuntimeKeysReady true if runtime Skeys have been computed
1788 * RuntimeContext expr context for evaling runtime Skeys
1789 * RelationDesc index relation descriptor
1790 * ScanDesc index scan descriptor
1791 * Instrument local index scan instrumentation
1792 * SharedInfo parallel worker instrumentation (no leader entry)
1793 * ----------------
1794 */
1796{
1797 ScanState ss; /* its first field is NodeTag */
1812
1813/* ----------------
1814 * BitmapHeapScanInstrumentation information
1815 *
1816 * exact_pages total number of exact pages retrieved
1817 * lossy_pages total number of lossy pages retrieved
1818 * ----------------
1819 */
1821{
1825
1826/* ----------------
1827 * SharedBitmapState information
1828 *
1829 * BM_INITIAL TIDBitmap creation is not yet started, so first worker
1830 * to see this state will set the state to BM_INPROGRESS
1831 * and that process will be responsible for creating
1832 * TIDBitmap.
1833 * BM_INPROGRESS TIDBitmap creation is in progress; workers need to
1834 * sleep until it's finished.
1835 * BM_FINISHED TIDBitmap creation is done, so now all workers can
1836 * proceed to iterate over TIDBitmap.
1837 * ----------------
1838 */
1839typedef enum
1840{
1845
1846/* ----------------
1847 * ParallelBitmapHeapState information
1848 * tbmiterator iterator for scanning current pages
1849 * mutex mutual exclusion for state
1850 * state current state of the TIDBitmap
1851 * cv conditional wait variable
1852 * ----------------
1853 */
1855{
1857 slock_t mutex;
1861
1862/* ----------------
1863 * Instrumentation data for a parallel bitmap heap scan.
1864 *
1865 * A shared memory struct that each parallel worker copies its
1866 * BitmapHeapScanInstrumentation information into at executor shutdown to
1867 * allow the leader to display the information in EXPLAIN ANALYZE.
1868 * ----------------
1869 */
1871{
1875
1876/* ----------------
1877 * BitmapHeapScanState information
1878 *
1879 * bitmapqualorig execution state for bitmapqualorig expressions
1880 * tbm bitmap obtained from child index scan(s)
1881 * stats execution statistics
1882 * initialized is node is ready to iterate
1883 * pstate shared state for parallel bitmap scan
1884 * sinstrument statistics for parallel workers
1885 * recheck do current page's tuples need recheck
1886 * ----------------
1887 */
1889{
1890 ScanState ss; /* its first field is NodeTag */
1899
1900/* ----------------
1901 * TidScanState information
1902 *
1903 * tidexprs list of TidExpr structs (see nodeTidscan.c)
1904 * isCurrentOf scan has a CurrentOfExpr qual
1905 * NumTids number of tids in this scan
1906 * TidPtr index of currently fetched tid
1907 * TidList evaluated item pointers (array of size NumTids)
1908 * ----------------
1909 */
1910typedef struct TidScanState
1911{
1912 ScanState ss; /* its first field is NodeTag */
1919
1920/* ----------------
1921 * TidRangeScanState information
1922 *
1923 * trss_tidexprs list of TidOpExpr structs (see nodeTidrangescan.c)
1924 * trss_mintid the lowest TID in the scan range
1925 * trss_maxtid the highest TID in the scan range
1926 * trss_inScan is a scan currently in progress?
1927 * ----------------
1928 */
1929typedef struct TidRangeScanState
1930{
1931 ScanState ss; /* its first field is NodeTag */
1937
1938/* ----------------
1939 * SubqueryScanState information
1940 *
1941 * SubqueryScanState is used for scanning a sub-query in the range table.
1942 * ScanTupleSlot references the current output tuple of the sub-query.
1943 * ----------------
1944 */
1945typedef struct SubqueryScanState
1946{
1947 ScanState ss; /* its first field is NodeTag */
1950
1951/* ----------------
1952 * FunctionScanState information
1953 *
1954 * Function nodes are used to scan the results of a
1955 * function appearing in FROM (typically a function returning set).
1956 *
1957 * eflags node's capability flags
1958 * ordinality is this scan WITH ORDINALITY?
1959 * simple true if we have 1 function and no ordinality
1960 * ordinal current ordinal column value
1961 * nfuncs number of functions being executed
1962 * funcstates per-function execution states (private in
1963 * nodeFunctionscan.c)
1964 * argcontext memory context to evaluate function arguments in
1965 * ----------------
1966 */
1968
1969typedef struct FunctionScanState
1970{
1971 ScanState ss; /* its first field is NodeTag */
1977 struct FunctionScanPerFuncState *funcstates; /* array of length nfuncs */
1980
1981/* ----------------
1982 * ValuesScanState information
1983 *
1984 * ValuesScan nodes are used to scan the results of a VALUES list
1985 *
1986 * rowcontext per-expression-list context
1987 * exprlists array of expression lists being evaluated
1988 * exprstatelists array of expression state lists, for SubPlans only
1989 * array_len size of above arrays
1990 * curr_idx current array index (0-based)
1991 *
1992 * Note: ss.ps.ps_ExprContext is used to evaluate any qual or projection
1993 * expressions attached to the node. We create a second ExprContext,
1994 * rowcontext, in which to build the executor expression state for each
1995 * Values sublist. Resetting this context lets us get rid of expression
1996 * state for each row, avoiding major memory leakage over a long values list.
1997 * However, that doesn't work for sublists containing SubPlans, because a
1998 * SubPlan has to be connected up to the outer plan tree to work properly.
1999 * Therefore, for only those sublists containing SubPlans, we do expression
2000 * state construction at executor start, and store those pointers in
2001 * exprstatelists[]. NULL entries in that array correspond to simple
2002 * subexpressions that are handled as described above.
2003 * ----------------
2004 */
2005typedef struct ValuesScanState
2006{
2007 ScanState ss; /* its first field is NodeTag */
2014
2015/* ----------------
2016 * TableFuncScanState node
2017 *
2018 * Used in table-expression functions like XMLTABLE.
2019 * ----------------
2020 */
2022{
2023 ScanState ss; /* its first field is NodeTag */
2024 ExprState *docexpr; /* state for document expression */
2025 ExprState *rowexpr; /* state for row-generating expression */
2026 List *colexprs; /* state for column-generating expression */
2027 List *coldefexprs; /* state for column default expressions */
2028 List *colvalexprs; /* state for column value expressions */
2029 List *passingvalexprs; /* state for PASSING argument expressions */
2030 List *ns_names; /* same as TableFunc.ns_names */
2031 List *ns_uris; /* list of states of namespace URI exprs */
2032 Bitmapset *notnulls; /* nullability flag for each output column */
2033 void *opaque; /* table builder private space */
2034 const struct TableFuncRoutine *routine; /* table builder methods */
2035 FmgrInfo *in_functions; /* input function for each column */
2036 Oid *typioparams; /* typioparam for each column */
2037 int64 ordinal; /* row number to be output next */
2038 MemoryContext perTableCxt; /* per-table context */
2039 Tuplestorestate *tupstore; /* output tuple store */
2041
2042/* ----------------
2043 * CteScanState information
2044 *
2045 * CteScan nodes are used to scan a CommonTableExpr query.
2046 *
2047 * Multiple CteScan nodes can read out from the same CTE query. We use
2048 * a tuplestore to hold rows that have been read from the CTE query but
2049 * not yet consumed by all readers.
2050 * ----------------
2051 */
2052typedef struct CteScanState
2053{
2054 ScanState ss; /* its first field is NodeTag */
2055 int eflags; /* capability flags to pass to tuplestore */
2056 int readptr; /* index of my tuplestore read pointer */
2057 PlanState *cteplanstate; /* PlanState for the CTE query itself */
2058 /* Link to the "leader" CteScanState (possibly this same node) */
2060 /* The remaining fields are only valid in the "leader" CteScanState */
2061 Tuplestorestate *cte_table; /* rows already read from the CTE query */
2062 bool eof_cte; /* reached end of CTE query? */
2064
2065/* ----------------
2066 * NamedTuplestoreScanState information
2067 *
2068 * NamedTuplestoreScan nodes are used to scan a Tuplestore created and
2069 * named prior to execution of the query. An example is a transition
2070 * table for an AFTER trigger.
2071 *
2072 * Multiple NamedTuplestoreScan nodes can read out from the same Tuplestore.
2073 * ----------------
2074 */
2076{
2077 ScanState ss; /* its first field is NodeTag */
2078 int readptr; /* index of my tuplestore read pointer */
2079 TupleDesc tupdesc; /* format of the tuples in the tuplestore */
2080 Tuplestorestate *relation; /* the rows */
2082
2083/* ----------------
2084 * WorkTableScanState information
2085 *
2086 * WorkTableScan nodes are used to scan the work table created by
2087 * a RecursiveUnion node. We locate the RecursiveUnion node
2088 * during executor startup.
2089 * ----------------
2090 */
2092{
2093 ScanState ss; /* its first field is NodeTag */
2096
2097/* ----------------
2098 * ForeignScanState information
2099 *
2100 * ForeignScan nodes are used to scan foreign-data tables.
2101 * ----------------
2102 */
2103typedef struct ForeignScanState
2104{
2105 ScanState ss; /* its first field is NodeTag */
2106 ExprState *fdw_recheck_quals; /* original quals not in ss.ps.qual */
2107 Size pscan_len; /* size of parallel coordination information */
2108 ResultRelInfo *resultRelInfo; /* result rel info, if UPDATE or DELETE */
2109 /* use struct pointer to avoid including fdwapi.h here */
2111 void *fdw_state; /* foreign-data wrapper can keep state here */
2113
2114/* ----------------
2115 * CustomScanState information
2116 *
2117 * CustomScan nodes are used to execute custom code within executor.
2118 *
2119 * Core code must avoid assuming that the CustomScanState is only as large as
2120 * the structure declared here; providers are allowed to make it the first
2121 * element in a larger structure, and typically would need to do so. The
2122 * struct is actually allocated by the CreateCustomScanState method associated
2123 * with the plan node. Any additional fields can be initialized there, or in
2124 * the BeginCustomScan method.
2125 * ----------------
2126 */
2127struct CustomExecMethods;
2128
2129typedef struct CustomScanState
2130{
2132 uint32 flags; /* mask of CUSTOMPATH_* flags, see
2133 * nodes/extensible.h */
2134 List *custom_ps; /* list of child PlanState nodes, if any */
2135 Size pscan_len; /* size of parallel coordination information */
2139
2140/* ----------------------------------------------------------------
2141 * Join State Information
2142 * ----------------------------------------------------------------
2143 */
2144
2145/* ----------------
2146 * JoinState information
2147 *
2148 * Superclass for state nodes of join plans.
2149 * ----------------
2150 */
2151typedef struct JoinState
2152{
2155 bool single_match; /* True if we should skip to next outer tuple
2156 * after finding one inner match */
2157 ExprState *joinqual; /* JOIN quals (in addition to ps.qual) */
2159
2160/* ----------------
2161 * NestLoopState information
2162 *
2163 * NeedNewOuter true if need new outer tuple on next call
2164 * MatchedOuter true if found a join match for current outer tuple
2165 * NullInnerTupleSlot prepared null tuple for left outer joins
2166 * ----------------
2167 */
2168typedef struct NestLoopState
2169{
2170 JoinState js; /* its first field is NodeTag */
2175
2176/* ----------------
2177 * MergeJoinState information
2178 *
2179 * NumClauses number of mergejoinable join clauses
2180 * Clauses info for each mergejoinable clause
2181 * JoinState current state of ExecMergeJoin state machine
2182 * SkipMarkRestore true if we may skip Mark and Restore operations
2183 * ExtraMarks true to issue extra Mark operations on inner scan
2184 * ConstFalseJoin true if we have a constant-false joinqual
2185 * FillOuter true if should emit unjoined outer tuples anyway
2186 * FillInner true if should emit unjoined inner tuples anyway
2187 * MatchedOuter true if found a join match for current outer tuple
2188 * MatchedInner true if found a join match for current inner tuple
2189 * OuterTupleSlot slot in tuple table for cur outer tuple
2190 * InnerTupleSlot slot in tuple table for cur inner tuple
2191 * MarkedTupleSlot slot in tuple table for marked tuple
2192 * NullOuterTupleSlot prepared null tuple for right outer joins
2193 * NullInnerTupleSlot prepared null tuple for left outer joins
2194 * OuterEContext workspace for computing outer tuple's join values
2195 * InnerEContext workspace for computing inner tuple's join values
2196 * ----------------
2197 */
2198/* private in nodeMergejoin.c: */
2200
2201typedef struct MergeJoinState
2202{
2203 JoinState js; /* its first field is NodeTag */
2205 MergeJoinClause mj_Clauses; /* array of length mj_NumClauses */
2222
2223/* ----------------
2224 * HashJoinState information
2225 *
2226 * hashclauses original form of the hashjoin condition
2227 * hj_OuterHash ExprState for hashing outer keys
2228 * hj_HashTable hash table for the hashjoin
2229 * (NULL if table not built yet)
2230 * hj_CurHashValue hash value for current outer tuple
2231 * hj_CurBucketNo regular bucket# for current outer tuple
2232 * hj_CurSkewBucketNo skew bucket# for current outer tuple
2233 * hj_CurTuple last inner tuple matched to current outer
2234 * tuple, or NULL if starting search
2235 * (hj_CurXXX variables are undefined if
2236 * OuterTupleSlot is empty!)
2237 * hj_OuterTupleSlot tuple slot for outer tuples
2238 * hj_HashTupleSlot tuple slot for inner (hashed) tuples
2239 * hj_NullOuterTupleSlot prepared null tuple for right/right-anti/full
2240 * outer joins
2241 * hj_NullInnerTupleSlot prepared null tuple for left/full outer joins
2242 * hj_FirstOuterTupleSlot first tuple retrieved from outer plan
2243 * hj_JoinState current state of ExecHashJoin state machine
2244 * hj_MatchedOuter true if found a join match for current outer
2245 * hj_OuterNotEmpty true if outer relation known not empty
2246 * ----------------
2247 */
2248
2249/* these structs are defined in executor/hashjoin.h: */
2252
2253typedef struct HashJoinState
2254{
2255 JoinState js; /* its first field is NodeTag */
2272
2273
2274/* ----------------------------------------------------------------
2275 * Materialization State Information
2276 * ----------------------------------------------------------------
2277 */
2278
2279/* ----------------
2280 * MaterialState information
2281 *
2282 * materialize nodes are used to materialize the results
2283 * of a subplan into a temporary file.
2284 *
2285 * ss.ss_ScanTupleSlot refers to output of underlying plan.
2286 * ----------------
2287 */
2288typedef struct MaterialState
2289{
2290 ScanState ss; /* its first field is NodeTag */
2291 int eflags; /* capability flags to pass to tuplestore */
2292 bool eof_underlying; /* reached end of underlying plan? */
2295
2296struct MemoizeEntry;
2297struct MemoizeTuple;
2298struct MemoizeKey;
2299
2301{
2302 uint64 cache_hits; /* number of rescans where we've found the
2303 * scan parameter values to be cached */
2304 uint64 cache_misses; /* number of rescans where we've not found the
2305 * scan parameter values to be cached. */
2306 uint64 cache_evictions; /* number of cache entries removed due to
2307 * the need to free memory */
2308 uint64 cache_overflows; /* number of times we've had to bypass the
2309 * cache when filling it due to not being
2310 * able to free enough space to store the
2311 * current scan's tuples. */
2312 uint64 mem_peak; /* peak memory usage in bytes */
2314
2315/* ----------------
2316 * Shared memory container for per-worker memoize information
2317 * ----------------
2318 */
2319typedef struct SharedMemoizeInfo
2320{
2324
2325/* ----------------
2326 * MemoizeState information
2327 *
2328 * memoize nodes are used to cache recent and commonly seen results from
2329 * a parameterized scan.
2330 * ----------------
2331 */
2332typedef struct MemoizeState
2333{
2334 ScanState ss; /* its first field is NodeTag */
2335 int mstatus; /* value of ExecMemoize state machine */
2336 int nkeys; /* number of cache keys */
2337 struct memoize_hash *hashtable; /* hash table for cache entries */
2338 TupleDesc hashkeydesc; /* tuple descriptor for cache keys */
2339 TupleTableSlot *tableslot; /* min tuple slot for existing cache entries */
2340 TupleTableSlot *probeslot; /* virtual slot used for hash lookups */
2341 ExprState *cache_eq_expr; /* Compare exec params to hash key */
2342 ExprState **param_exprs; /* exprs containing the parameters to this
2343 * node */
2344 FmgrInfo *hashfunctions; /* lookup data for hash funcs nkeys in size */
2345 Oid *collations; /* collation for comparisons nkeys in size */
2346 uint64 mem_used; /* bytes of memory used by cache */
2347 uint64 mem_limit; /* memory limit in bytes for the cache */
2348 MemoryContext tableContext; /* memory context to store cache data */
2349 dlist_head lru_list; /* least recently used entry list */
2350 struct MemoizeTuple *last_tuple; /* Used to point to the last tuple
2351 * returned during a cache hit and the
2352 * tuple we last stored when
2353 * populating the cache. */
2354 struct MemoizeEntry *entry; /* the entry that 'last_tuple' belongs to or
2355 * NULL if 'last_tuple' is NULL. */
2356 bool singlerow; /* true if the cache entry is to be marked as
2357 * complete after caching the first tuple. */
2358 bool binary_mode; /* true when cache key should be compared bit
2359 * by bit, false when using hash equality ops */
2360 MemoizeInstrumentation stats; /* execution statistics */
2361 SharedMemoizeInfo *shared_info; /* statistics for parallel workers */
2362 Bitmapset *keyparamids; /* Param->paramids of expressions belonging to
2363 * param_exprs */
2365
2366/* ----------------
2367 * When performing sorting by multiple keys, it's possible that the input
2368 * dataset is already sorted on a prefix of those keys. We call these
2369 * "presorted keys".
2370 * PresortedKeyData represents information about one such key.
2371 * ----------------
2372 */
2373typedef struct PresortedKeyData
2374{
2375 FmgrInfo flinfo; /* comparison function info */
2376 FunctionCallInfo fcinfo; /* comparison function call info */
2377 OffsetNumber attno; /* attribute number in tuple */
2379
2380/* ----------------
2381 * Shared memory container for per-worker sort information
2382 * ----------------
2383 */
2384typedef struct SharedSortInfo
2385{
2389
2390/* ----------------
2391 * SortState information
2392 * ----------------
2393 */
2394typedef struct SortState
2395{
2396 ScanState ss; /* its first field is NodeTag */
2397 bool randomAccess; /* need random access to sort output? */
2398 bool bounded; /* is the result set bounded? */
2399 int64 bound; /* if bounded, how many tuples are needed */
2400 bool sort_Done; /* sort completed yet? */
2401 bool bounded_Done; /* value of bounded we did the sort with */
2402 int64 bound_Done; /* value of bound we did the sort with */
2403 void *tuplesortstate; /* private state of tuplesort.c */
2404 bool am_worker; /* are we a worker? */
2405 bool datumSort; /* Datum sort instead of tuple sort? */
2406 SharedSortInfo *shared_info; /* one entry per worker */
2408
2409/* ----------------
2410 * Instrumentation information for IncrementalSort
2411 * ----------------
2412 */
2414{
2420 bits32 sortMethods; /* bitmask of TuplesortMethod */
2422
2424{
2428
2429/* ----------------
2430 * Shared memory container for per-worker incremental sort information
2431 * ----------------
2432 */
2434{
2438
2439/* ----------------
2440 * IncrementalSortState information
2441 * ----------------
2442 */
2443typedef enum
2444{
2450
2452{
2453 ScanState ss; /* its first field is NodeTag */
2454 bool bounded; /* is the result set bounded? */
2455 int64 bound; /* if bounded, how many tuples are needed */
2456 bool outerNodeDone; /* finished fetching tuples from outer node */
2457 int64 bound_Done; /* value of bound we did the sort with */
2460 Tuplesortstate *fullsort_state; /* private state of tuplesort.c */
2461 Tuplesortstate *prefixsort_state; /* private state of tuplesort.c */
2462 /* the keys by which the input path is already sorted */
2464
2466
2467 /* slot for pivot tuple defining values of presorted keys within group */
2470 bool am_worker; /* are we a worker? */
2471 SharedIncrementalSortInfo *shared_info; /* one entry per worker */
2473
2474/* ---------------------
2475 * GroupState information
2476 * ---------------------
2477 */
2478typedef struct GroupState
2479{
2480 ScanState ss; /* its first field is NodeTag */
2481 ExprState *eqfunction; /* equality function */
2482 bool grp_done; /* indicates completion of Group scan */
2484
2485/* ---------------------
2486 * per-worker aggregate information
2487 * ---------------------
2488 */
2490{
2491 Size hash_mem_peak; /* peak hash table memory usage */
2492 uint64 hash_disk_used; /* kB of disk space used */
2493 int hash_batches_used; /* batches used during entire execution */
2495
2496/* ----------------
2497 * Shared memory container for per-worker aggregate information
2498 * ----------------
2499 */
2500typedef struct SharedAggInfo
2501{
2505
2506/* ---------------------
2507 * AggState information
2508 *
2509 * ss.ss_ScanTupleSlot refers to output of underlying plan.
2510 *
2511 * Note: ss.ps.ps_ExprContext contains ecxt_aggvalues and
2512 * ecxt_aggnulls arrays, which hold the computed agg values for the current
2513 * input group during evaluation of an Agg node's output tuple(s). We
2514 * create a second ExprContext, tmpcontext, in which to evaluate input
2515 * expressions and run the aggregate transition functions.
2516 * ---------------------
2517 */
2518/* these structs are private in nodeAgg.c: */
2524
2525typedef struct AggState
2526{
2527 ScanState ss; /* its first field is NodeTag */
2528 List *aggs; /* all Aggref nodes in targetlist & quals */
2529 int numaggs; /* length of list (could be zero!) */
2530 int numtrans; /* number of pertrans items */
2531 AggStrategy aggstrategy; /* strategy mode */
2532 AggSplit aggsplit; /* agg-splitting mode, see nodes.h */
2533 AggStatePerPhase phase; /* pointer to current phase data */
2534 int numphases; /* number of phases (including phase 0) */
2535 int current_phase; /* current phase number */
2536 AggStatePerAgg peragg; /* per-Aggref information */
2537 AggStatePerTrans pertrans; /* per-Trans state information */
2538 ExprContext *hashcontext; /* econtexts for long-lived data (hashtable) */
2539 ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */
2540 ExprContext *tmpcontext; /* econtext for input expressions */
2541#define FIELDNO_AGGSTATE_CURAGGCONTEXT 14
2542 ExprContext *curaggcontext; /* currently active aggcontext */
2543 AggStatePerAgg curperagg; /* currently active aggregate, if any */
2544#define FIELDNO_AGGSTATE_CURPERTRANS 16
2545 AggStatePerTrans curpertrans; /* currently active trans state, if any */
2546 bool input_done; /* indicates end of input */
2547 bool agg_done; /* indicates completion of Agg scan */
2548 int projected_set; /* The last projected grouping set */
2549#define FIELDNO_AGGSTATE_CURRENT_SET 20
2550 int current_set; /* The current grouping set being evaluated */
2551 Bitmapset *grouped_cols; /* grouped cols in current projection */
2552 List *all_grouped_cols; /* list of all grouped cols in DESC order */
2553 Bitmapset *colnos_needed; /* all columns needed from the outer plan */
2554 int max_colno_needed; /* highest colno needed from outer plan */
2555 bool all_cols_needed; /* are all cols from outer plan needed? */
2556 /* These fields are for grouping set phase data */
2557 int maxsets; /* The max number of sets in any phase */
2558 AggStatePerPhase phases; /* array of all phases */
2559 Tuplesortstate *sort_in; /* sorted input to phases > 1 */
2560 Tuplesortstate *sort_out; /* input is copied here for next phase */
2561 TupleTableSlot *sort_slot; /* slot for sort results */
2562 /* these fields are used in AGG_PLAIN and AGG_SORTED modes: */
2563 AggStatePerGroup *pergroups; /* grouping set indexed array of per-group
2564 * pointers */
2565 HeapTuple grp_firstTuple; /* copy of first tuple of current group */
2566 /* these fields are used in AGG_HASHED and AGG_MIXED modes: */
2567 bool table_filled; /* hash table filled yet? */
2569 MemoryContext hash_metacxt; /* memory for hash table bucket array */
2570 MemoryContext hash_tablecxt; /* memory for hash table entries */
2571 struct LogicalTapeSet *hash_tapeset; /* tape set for hash spill tapes */
2572 struct HashAggSpill *hash_spills; /* HashAggSpill for each grouping set,
2573 * exists only during first pass */
2574 TupleTableSlot *hash_spill_rslot; /* for reading spill files */
2575 TupleTableSlot *hash_spill_wslot; /* for writing spill files */
2576 List *hash_batches; /* hash batches remaining to be processed */
2577 bool hash_ever_spilled; /* ever spilled during this execution? */
2578 bool hash_spill_mode; /* we hit a limit during the current batch
2579 * and we must not create new groups */
2580 Size hash_mem_limit; /* limit before spilling hash table */
2581 uint64 hash_ngroups_limit; /* limit before spilling hash table */
2582 int hash_planned_partitions; /* number of partitions planned
2583 * for first pass */
2584 double hashentrysize; /* estimate revised during execution */
2585 Size hash_mem_peak; /* peak hash table memory usage */
2586 uint64 hash_ngroups_current; /* number of groups currently in
2587 * memory in all hash tables */
2588 uint64 hash_disk_used; /* kB of disk space used */
2589 int hash_batches_used; /* batches used during entire execution */
2590
2591 AggStatePerHash perhash; /* array of per-hashtable data */
2592 AggStatePerGroup *hash_pergroup; /* grouping set indexed array of
2593 * per-group pointers */
2594
2595 /* support for evaluation of agg input expressions: */
2596#define FIELDNO_AGGSTATE_ALL_PERGROUPS 54
2597 AggStatePerGroup *all_pergroups; /* array of first ->pergroups, than
2598 * ->hash_pergroup */
2599 SharedAggInfo *shared_info; /* one entry per worker */
2601
2602/* ----------------
2603 * WindowAggState information
2604 * ----------------
2605 */
2606/* these structs are private in nodeWindowAgg.c: */
2609
2610/*
2611 * WindowAggStatus -- Used to track the status of WindowAggState
2612 */
2614{
2615 WINDOWAGG_DONE, /* No more processing to do */
2616 WINDOWAGG_RUN, /* Normal processing of window funcs */
2617 WINDOWAGG_PASSTHROUGH, /* Don't eval window funcs */
2618 WINDOWAGG_PASSTHROUGH_STRICT, /* Pass-through plus don't store new
2619 * tuples during spool */
2621
2622typedef struct WindowAggState
2623{
2624 ScanState ss; /* its first field is NodeTag */
2625
2626 /* these fields are filled in by ExecInitExpr: */
2627 List *funcs; /* all WindowFunc nodes in targetlist */
2628 int numfuncs; /* total number of window functions */
2629 int numaggs; /* number that are plain aggregates */
2630
2631 WindowStatePerFunc perfunc; /* per-window-function information */
2632 WindowStatePerAgg peragg; /* per-plain-aggregate information */
2633 ExprState *partEqfunction; /* equality funcs for partition columns */
2634 ExprState *ordEqfunction; /* equality funcs for ordering columns */
2635 Tuplestorestate *buffer; /* stores rows of current partition */
2636 int current_ptr; /* read pointer # for current row */
2637 int framehead_ptr; /* read pointer # for frame head, if used */
2638 int frametail_ptr; /* read pointer # for frame tail, if used */
2639 int grouptail_ptr; /* read pointer # for group tail, if used */
2640 int64 spooled_rows; /* total # of rows in buffer */
2641 int64 currentpos; /* position of current row in partition */
2642 int64 frameheadpos; /* current frame head position */
2643 int64 frametailpos; /* current frame tail position (frame end+1) */
2644 /* use struct pointer to avoid including windowapi.h here */
2645 struct WindowObjectData *agg_winobj; /* winobj for aggregate fetches */
2646 int64 aggregatedbase; /* start row for current aggregates */
2647 int64 aggregatedupto; /* rows before this one are aggregated */
2648 WindowAggStatus status; /* run status of WindowAggState */
2649
2650 int frameOptions; /* frame_clause options, see WindowDef */
2651 ExprState *startOffset; /* expression for starting bound offset */
2652 ExprState *endOffset; /* expression for ending bound offset */
2653 Datum startOffsetValue; /* result of startOffset evaluation */
2654 Datum endOffsetValue; /* result of endOffset evaluation */
2655
2656 /* these fields are used with RANGE offset PRECEDING/FOLLOWING: */
2657 FmgrInfo startInRangeFunc; /* in_range function for startOffset */
2658 FmgrInfo endInRangeFunc; /* in_range function for endOffset */
2659 Oid inRangeColl; /* collation for in_range tests */
2660 bool inRangeAsc; /* use ASC sort order for in_range tests? */
2661 bool inRangeNullsFirst; /* nulls sort first for in_range tests? */
2662
2663 /* fields relating to runconditions */
2664 bool use_pass_through; /* When false, stop execution when
2665 * runcondition is no longer true. Else
2666 * just stop evaluating window funcs. */
2667 bool top_window; /* true if this is the top-most WindowAgg or
2668 * the only WindowAgg in this query level */
2669 ExprState *runcondition; /* Condition which must remain true otherwise
2670 * execution of the WindowAgg will finish or
2671 * go into pass-through mode. NULL when there
2672 * is no such condition. */
2673
2674 /* these fields are used in GROUPS mode: */
2675 int64 currentgroup; /* peer group # of current row in partition */
2676 int64 frameheadgroup; /* peer group # of frame head row */
2677 int64 frametailgroup; /* peer group # of frame tail row */
2678 int64 groupheadpos; /* current row's peer group head position */
2679 int64 grouptailpos; /* " " " " tail position (group end+1) */
2680
2681 MemoryContext partcontext; /* context for partition-lifespan data */
2682 MemoryContext aggcontext; /* shared context for aggregate working data */
2683 MemoryContext curaggcontext; /* current aggregate's working data */
2684 ExprContext *tmpcontext; /* short-term evaluation context */
2685
2686 bool all_first; /* true if the scan is starting */
2687 bool partition_spooled; /* true if all tuples in current partition
2688 * have been spooled into tuplestore */
2689 bool next_partition; /* true if begin_partition needs to be called */
2690 bool more_partitions; /* true if there's more partitions after
2691 * this one */
2692 bool framehead_valid; /* true if frameheadpos is known up to
2693 * date for current row */
2694 bool frametail_valid; /* true if frametailpos is known up to
2695 * date for current row */
2696 bool grouptail_valid; /* true if grouptailpos is known up to
2697 * date for current row */
2698
2699 TupleTableSlot *first_part_slot; /* first tuple of current or next
2700 * partition */
2701 TupleTableSlot *framehead_slot; /* first tuple of current frame */
2702 TupleTableSlot *frametail_slot; /* first tuple after current frame */
2703
2704 /* temporary slots for tuples fetched back from tuplestore */
2709
2710/* ----------------
2711 * UniqueState information
2712 *
2713 * Unique nodes are used "on top of" sort nodes to discard
2714 * duplicate tuples returned from the sort phase. Basically
2715 * all it does is compare the current tuple from the subplan
2716 * with the previously fetched tuple (stored in its result slot).
2717 * If the two are identical in all interesting fields, then
2718 * we just fetch another tuple from the sort and try again.
2719 * ----------------
2720 */
2721typedef struct UniqueState
2722{
2723 PlanState ps; /* its first field is NodeTag */
2724 ExprState *eqfunction; /* tuple equality qual */
2726
2727/* ----------------
2728 * GatherState information
2729 *
2730 * Gather nodes launch 1 or more parallel workers, run a subplan
2731 * in those workers, and collect the results.
2732 * ----------------
2733 */
2734typedef struct GatherState
2735{
2736 PlanState ps; /* its first field is NodeTag */
2737 bool initialized; /* workers launched? */
2738 bool need_to_scan_locally; /* need to read from local plan? */
2739 int64 tuples_needed; /* tuple bound, see ExecSetTupleBound */
2740 /* these fields are set up once: */
2743 /* all remaining fields are reinitialized during a rescan: */
2744 int nworkers_launched; /* original number of workers */
2745 int nreaders; /* number of still-active workers */
2746 int nextreader; /* next one to try to read from */
2747 struct TupleQueueReader **reader; /* array with nreaders active entries */
2749
2750/* ----------------
2751 * GatherMergeState information
2752 *
2753 * Gather merge nodes launch 1 or more parallel workers, run a
2754 * subplan which produces sorted output in each worker, and then
2755 * merge the results into a single sorted stream.
2756 * ----------------
2757 */
2758struct GMReaderTupleBuffer; /* private in nodeGatherMerge.c */
2759
2760typedef struct GatherMergeState
2761{
2762 PlanState ps; /* its first field is NodeTag */
2763 bool initialized; /* workers launched? */
2764 bool gm_initialized; /* gather_merge_init() done? */
2765 bool need_to_scan_locally; /* need to read from local plan? */
2766 int64 tuples_needed; /* tuple bound, see ExecSetTupleBound */
2767 /* these fields are set up once: */
2768 TupleDesc tupDesc; /* descriptor for subplan result tuples */
2769 int gm_nkeys; /* number of sort columns */
2770 SortSupport gm_sortkeys; /* array of length gm_nkeys */
2772 /* all remaining fields are reinitialized during a rescan */
2773 /* (but the arrays are not reallocated, just cleared) */
2774 int nworkers_launched; /* original number of workers */
2775 int nreaders; /* number of active workers */
2776 TupleTableSlot **gm_slots; /* array with nreaders+1 entries */
2777 struct TupleQueueReader **reader; /* array with nreaders active entries */
2778 struct GMReaderTupleBuffer *gm_tuple_buffers; /* nreaders tuple buffers */
2779 struct binaryheap *gm_heap; /* binary heap of slot indices */
2781
2782/* ----------------
2783 * Values displayed by EXPLAIN ANALYZE
2784 * ----------------
2785 */
2787{
2788 int nbuckets; /* number of buckets at end of execution */
2789 int nbuckets_original; /* planned number of buckets */
2790 int nbatch; /* number of batches at end of execution */
2791 int nbatch_original; /* planned number of batches */
2792 Size space_peak; /* peak memory usage in bytes */
2794
2795/* ----------------
2796 * Shared memory container for per-worker hash information
2797 * ----------------
2798 */
2799typedef struct SharedHashInfo
2800{
2804
2805/* ----------------
2806 * HashState information
2807 * ----------------
2808 */
2809typedef struct HashState
2810{
2811 PlanState ps; /* its first field is NodeTag */
2812 HashJoinTable hashtable; /* hash table for the hashjoin */
2813 ExprState *hash_expr; /* ExprState to get hash value */
2814
2815 FmgrInfo *skew_hashfunction; /* lookup data for skew hash function */
2816 Oid skew_collation; /* collation to call skew_hashfunction with */
2817
2818 /*
2819 * In a parallelized hash join, the leader retains a pointer to the
2820 * shared-memory stats area in its shared_info field, and then copies the
2821 * shared-memory info back to local storage before DSM shutdown. The
2822 * shared_info field remains NULL in workers, or in non-parallel joins.
2823 */
2825
2826 /*
2827 * If we are collecting hash stats, this points to an initially-zeroed
2828 * collection area, which could be either local storage or in shared
2829 * memory; either way it's for just one process.
2830 */
2832
2833 /* Parallel hash state. */
2836
2837/* ----------------
2838 * SetOpState information
2839 *
2840 * SetOp nodes support either sorted or hashed de-duplication.
2841 * The sorted mode is a bit like MergeJoin, the hashed mode like Agg.
2842 * ----------------
2843 */
2845{
2846 TupleTableSlot *firstTupleSlot; /* first tuple of current group */
2847 int64 numTuples; /* number of tuples in current group */
2848 TupleTableSlot *nextTupleSlot; /* next input tuple, if already read */
2849 bool needGroup; /* do we need to load a new group? */
2851
2852typedef struct SetOpState
2853{
2854 PlanState ps; /* its first field is NodeTag */
2855 bool setop_done; /* indicates completion of output scan */
2856 int64 numOutput; /* number of dups left to output */
2857 int numCols; /* number of grouping columns */
2858
2859 /* these fields are used in SETOP_SORTED mode: */
2860 SortSupport sortKeys; /* per-grouping-field sort data */
2861 SetOpStatePerInput leftInput; /* current outer-relation input state */
2862 SetOpStatePerInput rightInput; /* current inner-relation input state */
2863 bool need_init; /* have we read the first tuples yet? */
2864
2865 /* these fields are used in SETOP_HASHED mode: */
2866 Oid *eqfuncoids; /* per-grouping-field equality fns */
2867 FmgrInfo *hashfunctions; /* per-grouping-field hash fns */
2868 TupleHashTable hashtable; /* hash table with one entry per group */
2869 MemoryContext tableContext; /* memory context containing hash table */
2870 bool table_filled; /* hash table filled yet? */
2871 TupleHashIterator hashiter; /* for iterating through hash table */
2873
2874/* ----------------
2875 * LockRowsState information
2876 *
2877 * LockRows nodes are used to enforce FOR [KEY] UPDATE/SHARE locking.
2878 * ----------------
2879 */
2880typedef struct LockRowsState
2881{
2882 PlanState ps; /* its first field is NodeTag */
2883 List *lr_arowMarks; /* List of ExecAuxRowMarks */
2884 EPQState lr_epqstate; /* for evaluating EvalPlanQual rechecks */
2886
2887/* ----------------
2888 * LimitState information
2889 *
2890 * Limit nodes are used to enforce LIMIT/OFFSET clauses.
2891 * They just select the desired subrange of their subplan's output.
2892 *
2893 * offset is the number of initial tuples to skip (0 does nothing).
2894 * count is the number of tuples to return after skipping the offset tuples.
2895 * If no limit count was specified, count is undefined and noCount is true.
2896 * When lstate == LIMIT_INITIAL, offset/count/noCount haven't been set yet.
2897 * ----------------
2898 */
2899typedef enum
2900{
2901 LIMIT_INITIAL, /* initial state for LIMIT node */
2902 LIMIT_RESCAN, /* rescan after recomputing parameters */
2903 LIMIT_EMPTY, /* there are no returnable rows */
2904 LIMIT_INWINDOW, /* have returned a row in the window */
2905 LIMIT_WINDOWEND_TIES, /* have returned a tied row */
2906 LIMIT_SUBPLANEOF, /* at EOF of subplan (within window) */
2907 LIMIT_WINDOWEND, /* stepped off end of window */
2908 LIMIT_WINDOWSTART, /* stepped off beginning of window */
2910
2911typedef struct LimitState
2912{
2913 PlanState ps; /* its first field is NodeTag */
2914 ExprState *limitOffset; /* OFFSET parameter, or NULL if none */
2915 ExprState *limitCount; /* COUNT parameter, or NULL if none */
2916 LimitOption limitOption; /* limit specification type */
2917 int64 offset; /* current OFFSET value */
2918 int64 count; /* current COUNT, if any */
2919 bool noCount; /* if true, ignore count */
2920 LimitStateCond lstate; /* state machine status, as above */
2921 int64 position; /* 1-based index of last tuple returned */
2922 TupleTableSlot *subSlot; /* tuple last obtained from subplan */
2923 ExprState *eqfunction; /* tuple equality qual in case of WITH TIES
2924 * option */
2925 TupleTableSlot *last_slot; /* slot for evaluation of ties */
2927
2928#endif /* EXECNODES_H */
int16 AttrNumber
Definition: attnum.h:21
int Buffer
Definition: buf.h:23
uint8_t uint8
Definition: c.h:537
int64_t int64
Definition: c.h:536
#define FLEXIBLE_ARRAY_MEMBER
Definition: c.h:471
int16_t int16
Definition: c.h:534
uint32 bits32
Definition: c.h:548
uint64_t uint64
Definition: c.h:540
uint16_t uint16
Definition: c.h:538
uint32_t uint32
Definition: c.h:539
unsigned int Index
Definition: c.h:620
uint32 CommandId
Definition: c.h:672
size_t Size
Definition: c.h:611
uint64 dsa_pointer
Definition: dsa.h:62
void(* ExprContextCallbackFunction)(Datum arg)
Definition: execnodes.h:235
struct WindowStatePerAggData * WindowStatePerAgg
Definition: execnodes.h:2608
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:2444
@ INCSORT_READFULLSORT
Definition: execnodes.h:2447
@ INCSORT_LOADPREFIXSORT
Definition: execnodes.h:2446
@ INCSORT_READPREFIXSORT
Definition: execnodes.h:2448
@ INCSORT_LOADFULLSORT
Definition: execnodes.h:2445
struct EPQState EPQState
struct GatherMergeState GatherMergeState
struct LimitState LimitState
struct ExprState ExprState
Definition: execnodes.h:57
WindowAggStatus
Definition: execnodes.h:2614
@ WINDOWAGG_PASSTHROUGH
Definition: execnodes.h:2617
@ WINDOWAGG_RUN
Definition: execnodes.h:2616
@ WINDOWAGG_DONE
Definition: execnodes.h:2615
@ WINDOWAGG_PASSTHROUGH_STRICT
Definition: execnodes.h:2618
struct JunkFilter JunkFilter
struct ResultRelInfo ResultRelInfo
struct CustomScanState CustomScanState
struct OnConflictSetState OnConflictSetState
struct BitmapOrState BitmapOrState
struct IncrementalSortInfo IncrementalSortInfo
struct WindowFuncExprState WindowFuncExprState
struct HashJoinState HashJoinState
struct HashJoinTableData * HashJoinTable
Definition: execnodes.h:2251
struct SeqScanState SeqScanState
struct HashJoinTupleData * HashJoinTuple
Definition: execnodes.h:2250
struct TupleHashEntryData * TupleHashEntry
Definition: execnodes.h:844
struct SortState SortState
struct BitmapAndState BitmapAndState
struct AggState AggState
SharedBitmapState
Definition: execnodes.h:1840
@ BM_INITIAL
Definition: execnodes.h:1841
@ BM_FINISHED
Definition: execnodes.h:1843
@ BM_INPROGRESS
Definition: execnodes.h:1842
struct NestLoopState NestLoopState
struct MemoizeInstrumentation MemoizeInstrumentation
struct SharedBitmapHeapInstrumentation SharedBitmapHeapInstrumentation
struct SetExprState SetExprState
struct GroupState GroupState
struct BitmapHeapScanInstrumentation BitmapHeapScanInstrumentation
struct MaterialState MaterialState
struct WindowStatePerFuncData * WindowStatePerFunc
Definition: execnodes.h:2607
struct ExprContext_CB ExprContext_CB
struct TidRangeScanState TidRangeScanState
struct AggStatePerHashData * AggStatePerHash
Definition: execnodes.h:2523
struct TupleHashTableData * TupleHashTable
Definition: execnodes.h:845
struct SampleScanState SampleScanState
LimitStateCond
Definition: execnodes.h:2900
@ LIMIT_WINDOWEND_TIES
Definition: execnodes.h:2905
@ LIMIT_WINDOWEND
Definition: execnodes.h:2907
@ LIMIT_INWINDOW
Definition: execnodes.h:2904
@ LIMIT_SUBPLANEOF
Definition: execnodes.h:2906
@ LIMIT_WINDOWSTART
Definition: execnodes.h:2908
@ LIMIT_EMPTY
Definition: execnodes.h:2903
@ LIMIT_INITIAL
Definition: execnodes.h:2901
@ LIMIT_RESCAN
Definition: execnodes.h:2902
struct GatherState GatherState
struct MergeJoinClauseData * MergeJoinClause
Definition: execnodes.h:2199
struct ParallelBitmapHeapState ParallelBitmapHeapState
struct MergeJoinState MergeJoinState
ExprDoneCond
Definition: execnodes.h:326
@ ExprSingleResult
Definition: execnodes.h:327
@ ExprMultipleResult
Definition: execnodes.h:328
@ ExprEndResult
Definition: execnodes.h:329
struct AggStatePerGroupData * AggStatePerGroup
Definition: execnodes.h:2521
struct ForeignScanState ForeignScanState
struct FunctionScanState FunctionScanState
struct AggStatePerPhaseData * AggStatePerPhase
Definition: execnodes.h:2522
struct WindowAggState WindowAggState
struct AggStatePerTransData * AggStatePerTrans
Definition: execnodes.h:2520
struct NamedTuplestoreScanState NamedTuplestoreScanState
struct SubqueryScanState SubqueryScanState
DomainConstraintType
Definition: execnodes.h:1042
@ DOM_CONSTRAINT_CHECK
Definition: execnodes.h:1044
@ DOM_CONSTRAINT_NOTNULL
Definition: execnodes.h:1043
struct TableFuncScanState TableFuncScanState
struct RecursiveUnionState RecursiveUnionState
struct TupleHashEntryData TupleHashEntryData
struct SharedSortInfo SharedSortInfo
struct ScanState ScanState
tuplehash_iterator TupleHashIterator
Definition: execnodes.h:881
struct MergeActionState MergeActionState
struct AggregateInstrumentation AggregateInstrumentation
struct TidScanState TidScanState
struct SharedHashInfo SharedHashInfo
struct ProjectSetState ProjectSetState
struct IncrementalSortState IncrementalSortState
struct JsonExprState JsonExprState
struct ReturnSetInfo ReturnSetInfo
struct AggStatePerAggData * AggStatePerAgg
Definition: execnodes.h:2519
SetFunctionReturnMode
Definition: execnodes.h: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:1144
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:1528
uint64_t Datum
Definition: postgres.h:70
unsigned int Oid
Definition: postgres_ext.h:32
#define NUM_MERGE_MATCH_KINDS
Definition: primnodes.h:2012
ScanDirection
Definition: sdir.h:25
MemoryContext hash_metacxt
Definition: execnodes.h:2569
ScanState ss
Definition: execnodes.h:2527
Tuplesortstate * sort_out
Definition: execnodes.h:2560
uint64 hash_disk_used
Definition: execnodes.h:2588
AggStatePerGroup * all_pergroups
Definition: execnodes.h:2597
AggStatePerGroup * hash_pergroup
Definition: execnodes.h:2592
AggStatePerPhase phase
Definition: execnodes.h:2533
List * aggs
Definition: execnodes.h:2528
ExprContext * tmpcontext
Definition: execnodes.h:2540
int max_colno_needed
Definition: execnodes.h:2554
int hash_planned_partitions
Definition: execnodes.h:2582
HeapTuple grp_firstTuple
Definition: execnodes.h:2565
Size hash_mem_limit
Definition: execnodes.h:2580
ExprContext * curaggcontext
Definition: execnodes.h:2542
MemoryContext hash_tablecxt
Definition: execnodes.h:2570
AggStatePerTrans curpertrans
Definition: execnodes.h:2545
bool table_filled
Definition: execnodes.h:2567
AggStatePerTrans pertrans
Definition: execnodes.h:2537
int current_set
Definition: execnodes.h:2550
struct LogicalTapeSet * hash_tapeset
Definition: execnodes.h:2571
AggStrategy aggstrategy
Definition: execnodes.h:2531
int numtrans
Definition: execnodes.h:2530
ExprContext * hashcontext
Definition: execnodes.h:2538
AggSplit aggsplit
Definition: execnodes.h:2532
int projected_set
Definition: execnodes.h:2548
SharedAggInfo * shared_info
Definition: execnodes.h:2599
uint64 hash_ngroups_limit
Definition: execnodes.h:2581
bool input_done
Definition: execnodes.h:2546
AggStatePerPhase phases
Definition: execnodes.h:2558
List * all_grouped_cols
Definition: execnodes.h:2552
bool hash_spill_mode
Definition: execnodes.h:2578
AggStatePerGroup * pergroups
Definition: execnodes.h:2563
AggStatePerHash perhash
Definition: execnodes.h:2591
Size hash_mem_peak
Definition: execnodes.h:2585
double hashentrysize
Definition: execnodes.h:2584
int numphases
Definition: execnodes.h:2534
uint64 hash_ngroups_current
Definition: execnodes.h:2586
int hash_batches_used
Definition: execnodes.h:2589
Tuplesortstate * sort_in
Definition: execnodes.h:2559
TupleTableSlot * hash_spill_wslot
Definition: execnodes.h:2575
AggStatePerAgg curperagg
Definition: execnodes.h:2543
struct HashAggSpill * hash_spills
Definition: execnodes.h:2572
TupleTableSlot * sort_slot
Definition: execnodes.h:2561
bool hash_ever_spilled
Definition: execnodes.h:2577
int numaggs
Definition: execnodes.h:2529
int num_hashes
Definition: execnodes.h:2568
AggStatePerAgg peragg
Definition: execnodes.h:2536
List * hash_batches
Definition: execnodes.h:2576
TupleTableSlot * hash_spill_rslot
Definition: execnodes.h:2574
int maxsets
Definition: execnodes.h:2557
ExprContext ** aggcontexts
Definition: execnodes.h:2539
Bitmapset * colnos_needed
Definition: execnodes.h:2553
int current_phase
Definition: execnodes.h:2535
bool all_cols_needed
Definition: execnodes.h:2555
bool agg_done
Definition: execnodes.h:2547
Bitmapset * grouped_cols
Definition: execnodes.h:2551
struct PartitionPruneState * as_prune_state
Definition: execnodes.h:1510
Bitmapset * as_valid_asyncplans
Definition: execnodes.h:1513
Bitmapset * as_needrequest
Definition: execnodes.h:1503
bool as_syncdone
Definition: execnodes.h:1500
AsyncRequest ** as_asyncrequests
Definition: execnodes.h:1497
bool as_begun
Definition: execnodes.h:1494
Bitmapset * as_asyncplans
Definition: execnodes.h:1495
int as_whichplan
Definition: execnodes.h:1493
int as_nasyncresults
Definition: execnodes.h:1499
struct WaitEventSet * as_eventset
Definition: execnodes.h:1504
bool(* choose_next_subplan)(AppendState *)
Definition: execnodes.h:1514
PlanState ** appendplans
Definition: execnodes.h:1491
int as_first_partial_plan
Definition: execnodes.h:1506
PlanState ps
Definition: execnodes.h:1490
int as_nasyncremain
Definition: execnodes.h:1502
ParallelAppendState * as_pstate
Definition: execnodes.h:1508
Bitmapset * as_valid_subplans
Definition: execnodes.h:1512
Size pstate_len
Definition: execnodes.h:1509
TupleTableSlot ** as_asyncresults
Definition: execnodes.h:1498
int as_nasyncplans
Definition: execnodes.h:1496
bool as_valid_subplans_identified
Definition: execnodes.h:1511
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:1578
PlanState ** bitmapplans
Definition: execnodes.h:1579
ParallelBitmapHeapState * pstate
Definition: execnodes.h:1895
ExprState * bitmapqualorig
Definition: execnodes.h:1891
BitmapHeapScanInstrumentation stats
Definition: execnodes.h:1893
SharedBitmapHeapInstrumentation * sinstrument
Definition: execnodes.h:1896
TIDBitmap * tbm
Definition: execnodes.h:1892
ExprContext * biss_RuntimeContext
Definition: execnodes.h:1806
IndexArrayKeyInfo * biss_ArrayKeys
Definition: execnodes.h:1803
ScanKeyData * biss_ScanKeys
Definition: execnodes.h:1799
IndexRuntimeKeyInfo * biss_RuntimeKeys
Definition: execnodes.h:1801
SharedIndexScanInstrumentation * biss_SharedInfo
Definition: execnodes.h:1810
TIDBitmap * biss_result
Definition: execnodes.h:1798
struct IndexScanDescData * biss_ScanDesc
Definition: execnodes.h:1808
Relation biss_RelationDesc
Definition: execnodes.h:1807
IndexScanInstrumentation biss_Instrument
Definition: execnodes.h:1809
PlanState ps
Definition: execnodes.h:1589
PlanState ** bitmapplans
Definition: execnodes.h:1590
Tuplestorestate * cte_table
Definition: execnodes.h:2061
ScanState ss
Definition: execnodes.h:2054
PlanState * cteplanstate
Definition: execnodes.h:2057
struct CteScanState * leader
Definition: execnodes.h:2059
const struct TupleTableSlotOps * slotOps
Definition: execnodes.h:2137
const struct CustomExecMethods * methods
Definition: execnodes.h:2136
List * custom_ps
Definition: execnodes.h:2134
ScanState ss
Definition: execnodes.h:2131
DomainConstraintType constrainttype
Definition: execnodes.h:1050
ExprState * check_exprstate
Definition: execnodes.h:1053
ExecAuxRowMark ** relsubs_rowmark
Definition: execnodes.h:1334
TupleTableSlot * origslot
Definition: execnodes.h:1322
TupleTableSlot ** relsubs_slot
Definition: execnodes.h:1306
Plan * plan
Definition: execnodes.h:1313
int epqParam
Definition: execnodes.h:1296
bool * relsubs_blocked
Definition: execnodes.h:1350
EState * parentestate
Definition: execnodes.h:1295
EState * recheckestate
Definition: execnodes.h:1327
PlanState * recheckplanstate
Definition: execnodes.h:1352
List * resultRelations
Definition: execnodes.h:1297
List * arowMarks
Definition: execnodes.h:1314
List * tuple_table
Definition: execnodes.h:1305
bool * relsubs_done
Definition: execnodes.h:1341
uint64 es_processed
Definition: execnodes.h: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:2110
ExprState * fdw_recheck_quals
Definition: execnodes.h:2106
ResultRelInfo * resultRelInfo
Definition: execnodes.h:2108
ScanState ss
Definition: execnodes.h:2105
struct FunctionScanPerFuncState * funcstates
Definition: execnodes.h:1977
MemoryContext argcontext
Definition: execnodes.h:1978
struct ParallelExecutorInfo * pei
Definition: execnodes.h:2771
TupleDesc tupDesc
Definition: execnodes.h:2768
struct TupleQueueReader ** reader
Definition: execnodes.h:2777
SortSupport gm_sortkeys
Definition: execnodes.h:2770
struct GMReaderTupleBuffer * gm_tuple_buffers
Definition: execnodes.h:2778
TupleTableSlot ** gm_slots
Definition: execnodes.h:2776
bool need_to_scan_locally
Definition: execnodes.h:2765
struct binaryheap * gm_heap
Definition: execnodes.h:2779
PlanState ps
Definition: execnodes.h:2762
bool initialized
Definition: execnodes.h:2737
TupleTableSlot * funnel_slot
Definition: execnodes.h:2741
struct ParallelExecutorInfo * pei
Definition: execnodes.h:2742
int nextreader
Definition: execnodes.h:2746
int nworkers_launched
Definition: execnodes.h:2744
PlanState ps
Definition: execnodes.h:2736
struct TupleQueueReader ** reader
Definition: execnodes.h:2747
int64 tuples_needed
Definition: execnodes.h:2739
bool need_to_scan_locally
Definition: execnodes.h:2738
ExprState * eqfunction
Definition: execnodes.h:2481
ScanState ss
Definition: execnodes.h:2480
bool grp_done
Definition: execnodes.h:2482
Definition: dynahash.c:222
HashJoinTuple hj_CurTuple
Definition: execnodes.h:2262
int hj_CurSkewBucketNo
Definition: execnodes.h:2261
ExprState * hj_OuterHash
Definition: execnodes.h:2257
TupleTableSlot * hj_NullOuterTupleSlot
Definition: execnodes.h:2265
TupleTableSlot * hj_OuterTupleSlot
Definition: execnodes.h:2263
bool hj_OuterNotEmpty
Definition: execnodes.h:2270
TupleTableSlot * hj_NullInnerTupleSlot
Definition: execnodes.h:2266
ExprState * hashclauses
Definition: execnodes.h:2256
JoinState js
Definition: execnodes.h:2255
TupleTableSlot * hj_FirstOuterTupleSlot
Definition: execnodes.h:2267
bool hj_MatchedOuter
Definition: execnodes.h:2269
uint32 hj_CurHashValue
Definition: execnodes.h:2259
int hj_CurBucketNo
Definition: execnodes.h:2260
HashJoinTable hj_HashTable
Definition: execnodes.h:2258
TupleTableSlot * hj_HashTupleSlot
Definition: execnodes.h:2264
struct ParallelHashJoinState * parallel_state
Definition: execnodes.h:2834
HashJoinTable hashtable
Definition: execnodes.h:2812
SharedHashInfo * shared_info
Definition: execnodes.h:2824
ExprState * hash_expr
Definition: execnodes.h:2813
Oid skew_collation
Definition: execnodes.h:2816
FmgrInfo * skew_hashfunction
Definition: execnodes.h:2815
PlanState ps
Definition: execnodes.h:2811
HashInstrumentation * hinstrument
Definition: execnodes.h:2831
IncrementalSortGroupInfo prefixsortGroupInfo
Definition: execnodes.h:2426
IncrementalSortGroupInfo fullsortGroupInfo
Definition: execnodes.h:2425
Tuplesortstate * prefixsort_state
Definition: execnodes.h:2461
TupleTableSlot * group_pivot
Definition: execnodes.h:2468
TupleTableSlot * transfer_tuple
Definition: execnodes.h:2469
Tuplesortstate * fullsort_state
Definition: execnodes.h:2460
SharedIncrementalSortInfo * shared_info
Definition: execnodes.h:2471
IncrementalSortExecutionStatus execution_status
Definition: execnodes.h:2458
PresortedKeyData * presorted_keys
Definition: execnodes.h:2463
IncrementalSortInfo incsort_info
Definition: execnodes.h:2465
ScanKeyData * scan_key
Definition: execnodes.h:1666
Datum * elem_values
Definition: execnodes.h:1670
ExprState * array_expr
Definition: execnodes.h:1667
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:1769
TupleTableSlot * ioss_TableSlot
Definition: execnodes.h:1770
bool ioss_RuntimeKeysReady
Definition: execnodes.h:1764
ExprState * recheckqual
Definition: execnodes.h:1757
struct IndexScanDescData * ioss_ScanDesc
Definition: execnodes.h:1767
ScanKeyData * ioss_OrderByKeys
Definition: execnodes.h:1760
ScanKeyData * ioss_ScanKeys
Definition: execnodes.h:1758
ExprContext * ioss_RuntimeContext
Definition: execnodes.h:1765
AttrNumber * ioss_NameCStringAttNums
Definition: execnodes.h:1773
Relation ioss_RelationDesc
Definition: execnodes.h:1766
IndexScanInstrumentation ioss_Instrument
Definition: execnodes.h:1768
IndexRuntimeKeyInfo * ioss_RuntimeKeys
Definition: execnodes.h:1762
ExprState * key_expr
Definition: execnodes.h:1660
ScanKeyData * scan_key
Definition: execnodes.h:1659
bool iss_ReachedEnd
Definition: execnodes.h:1722
List * indexorderbyorig
Definition: execnodes.h:1706
bool * iss_OrderByTypByVals
Definition: execnodes.h:1726
int iss_NumRuntimeKeys
Definition: execnodes.h:1712
struct IndexScanDescData * iss_ScanDesc
Definition: execnodes.h:1716
IndexScanInstrumentation iss_Instrument
Definition: execnodes.h:1717
ExprState * indexqualorig
Definition: execnodes.h:1705
Relation iss_RelationDesc
Definition: execnodes.h:1715
pairingheap * iss_ReorderQueue
Definition: execnodes.h:1721
ScanState ss
Definition: execnodes.h:1704
bool * iss_OrderByNulls
Definition: execnodes.h:1724
bool iss_RuntimeKeysReady
Definition: execnodes.h:1713
ScanKeyData * iss_ScanKeys
Definition: execnodes.h:1707
ScanKeyData * iss_OrderByKeys
Definition: execnodes.h:1709
SortSupport iss_SortSupport
Definition: execnodes.h:1725
int iss_NumOrderByKeys
Definition: execnodes.h:1710
SharedIndexScanInstrumentation * iss_SharedInfo
Definition: execnodes.h:1718
ExprContext * iss_RuntimeContext
Definition: execnodes.h:1714
Datum * iss_OrderByValues
Definition: execnodes.h:1723
int16 * iss_OrderByTypLens
Definition: execnodes.h:1727
IndexRuntimeKeyInfo * iss_RuntimeKeys
Definition: execnodes.h:1711
Definition: jit.h:58
JoinType jointype
Definition: execnodes.h:2154
PlanState ps
Definition: execnodes.h:2153
ExprState * joinqual
Definition: execnodes.h:2157
bool single_match
Definition: execnodes.h:2155
int jump_eval_coercion
Definition: execnodes.h:1101
NullableDatum empty
Definition: execnodes.h:1087
FunctionCallInfo input_fcinfo
Definition: execnodes.h:1115
JsonExpr * jsexpr
Definition: execnodes.h:1065
NullableDatum error
Definition: execnodes.h:1084
NullableDatum pathspec
Definition: execnodes.h:1071
ErrorSaveContext escontext
Definition: execnodes.h:1124
NullableDatum formatted_expr
Definition: execnodes.h:1068
TupleDesc jf_cleanTupType
Definition: execnodes.h: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:2913
ExprState * limitOffset
Definition: execnodes.h:2914
ExprState * limitCount
Definition: execnodes.h:2915
LimitOption limitOption
Definition: execnodes.h:2916
bool noCount
Definition: execnodes.h:2919
int64 position
Definition: execnodes.h:2921
TupleTableSlot * last_slot
Definition: execnodes.h:2925
int64 offset
Definition: execnodes.h:2917
ExprState * eqfunction
Definition: execnodes.h:2923
int64 count
Definition: execnodes.h:2918
LimitStateCond lstate
Definition: execnodes.h:2920
TupleTableSlot * subSlot
Definition: execnodes.h:2922
Definition: pg_list.h:54
PlanState ps
Definition: execnodes.h:2882
List * lr_arowMarks
Definition: execnodes.h:2883
EPQState lr_epqstate
Definition: execnodes.h:2884
bool eof_underlying
Definition: execnodes.h:2292
Tuplestorestate * tuplestorestate
Definition: execnodes.h:2293
ScanState ss
Definition: execnodes.h:2290
TupleDesc hashkeydesc
Definition: execnodes.h:2338
uint64 mem_used
Definition: execnodes.h:2346
FmgrInfo * hashfunctions
Definition: execnodes.h:2344
Oid * collations
Definition: execnodes.h:2345
TupleTableSlot * probeslot
Definition: execnodes.h:2340
SharedMemoizeInfo * shared_info
Definition: execnodes.h:2361
struct MemoizeEntry * entry
Definition: execnodes.h:2354
ExprState * cache_eq_expr
Definition: execnodes.h:2341
MemoizeInstrumentation stats
Definition: execnodes.h:2360
bool singlerow
Definition: execnodes.h:2356
dlist_head lru_list
Definition: execnodes.h:2349
MemoryContext tableContext
Definition: execnodes.h:2348
bool binary_mode
Definition: execnodes.h:2358
Bitmapset * keyparamids
Definition: execnodes.h:2362
ScanState ss
Definition: execnodes.h:2334
uint64 mem_limit
Definition: execnodes.h:2347
ExprState ** param_exprs
Definition: execnodes.h:2342
struct memoize_hash * hashtable
Definition: execnodes.h:2337
TupleTableSlot * tableslot
Definition: execnodes.h:2339
struct MemoizeTuple * last_tuple
Definition: execnodes.h:2350
MergeAction * mas_action
Definition: execnodes.h:449
ProjectionInfo * mas_proj
Definition: execnodes.h:450
ExprState * mas_whenqual
Definition: execnodes.h:452
PlanState ** mergeplans
Definition: execnodes.h:1535
SortSupport ms_sortkeys
Definition: execnodes.h:1538
Bitmapset * ms_valid_subplans
Definition: execnodes.h:1543
PlanState ps
Definition: execnodes.h:1534
struct binaryheap * ms_heap
Definition: execnodes.h:1540
TupleTableSlot ** ms_slots
Definition: execnodes.h:1539
struct PartitionPruneState * ms_prune_state
Definition: execnodes.h:1542
bool mj_MatchedOuter
Definition: execnodes.h:2212
bool mj_SkipMarkRestore
Definition: execnodes.h:2207
bool mj_ConstFalseJoin
Definition: execnodes.h:2209
TupleTableSlot * mj_MarkedTupleSlot
Definition: execnodes.h:2216
TupleTableSlot * mj_NullInnerTupleSlot
Definition: execnodes.h:2218
ExprContext * mj_InnerEContext
Definition: execnodes.h:2220
TupleTableSlot * mj_NullOuterTupleSlot
Definition: execnodes.h:2217
bool mj_ExtraMarks
Definition: execnodes.h:2208
MergeJoinClause mj_Clauses
Definition: execnodes.h:2205
bool mj_MatchedInner
Definition: execnodes.h:2213
TupleTableSlot * mj_InnerTupleSlot
Definition: execnodes.h:2215
ExprContext * mj_OuterEContext
Definition: execnodes.h:2219
JoinState js
Definition: execnodes.h:2203
TupleTableSlot * mj_OuterTupleSlot
Definition: execnodes.h:2214
List * mt_mergeJoinConditions
Definition: execnodes.h:1466
CmdType operation
Definition: execnodes.h:1398
TupleTableSlot * mt_merge_pending_not_matched
Definition: execnodes.h:1452
ResultRelInfo * resultRelInfo
Definition: execnodes.h:1402
double mt_merge_deleted
Definition: execnodes.h:1457
struct PartitionTupleRouting * mt_partition_tuple_routing
Definition: execnodes.h:1433
List * mt_updateColnosLists
Definition: execnodes.h:1464
double mt_merge_inserted
Definition: execnodes.h:1455
TupleTableSlot * mt_root_tuple_slot
Definition: execnodes.h:1430
EPQState mt_epqstate
Definition: execnodes.h:1412
int mt_merge_subcommands
Definition: execnodes.h:1442
double mt_merge_updated
Definition: execnodes.h:1456
PlanState ps
Definition: execnodes.h:1397
List * mt_mergeActionLists
Definition: execnodes.h:1465
HTAB * mt_resultOidHash
Definition: execnodes.h:1424
ResultRelInfo * rootResultRelInfo
Definition: execnodes.h:1410
struct TransitionCaptureState * mt_transition_capture
Definition: execnodes.h:1436
struct TransitionCaptureState * mt_oc_transition_capture
Definition: execnodes.h:1439
MergeActionState * mt_merge_action
Definition: execnodes.h:1445
Tuplestorestate * relation
Definition: execnodes.h:2080
TupleTableSlot * nl_NullInnerTupleSlot
Definition: execnodes.h:2173
bool nl_NeedNewOuter
Definition: execnodes.h:2171
JoinState js
Definition: execnodes.h:2170
bool nl_MatchedOuter
Definition: execnodes.h:2172
Definition: nodes.h:135
TupleTableSlot * oc_ProjSlot
Definition: execnodes.h: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:1858
dsa_pointer tbmiterator
Definition: execnodes.h:1856
ConditionVariable cv
Definition: execnodes.h:1859
bool inneropsset
Definition: execnodes.h:1243
const TupleTableSlotOps * resultops
Definition: execnodes.h:1236
bool outeropsset
Definition: execnodes.h:1242
struct SharedJitInstrumentation * worker_jit_instrument
Definition: execnodes.h:1173
Instrumentation * instrument
Definition: execnodes.h:1169
ExecProcNodeMtd ExecProcNodeReal
Definition: execnodes.h:1166
const TupleTableSlotOps * outerops
Definition: execnodes.h:1234
const TupleTableSlotOps * innerops
Definition: execnodes.h:1235
bool resultopsset
Definition: execnodes.h:1244
ExprState * qual
Definition: execnodes.h:1180
const TupleTableSlotOps * scanops
Definition: execnodes.h:1233
Plan * plan
Definition: execnodes.h:1159
PlanState * righttree
Definition: execnodes.h:1182
bool outeropsfixed
Definition: execnodes.h:1238
List * subPlan
Definition: execnodes.h:1186
EState * state
Definition: execnodes.h:1161
TupleDesc ps_ResultTupleDesc
Definition: execnodes.h:1196
WorkerInstrumentation * worker_instrument
Definition: execnodes.h:1170
pg_node_attr(abstract) NodeTag type
List * initPlan
Definition: execnodes.h:1184
Bitmapset * chgParam
Definition: execnodes.h:1191
bool scanopsset
Definition: execnodes.h:1241
PlanState * lefttree
Definition: execnodes.h:1181
ExprContext * ps_ExprContext
Definition: execnodes.h:1198
TupleTableSlot * ps_ResultTupleSlot
Definition: execnodes.h:1197
TupleDesc scandesc
Definition: execnodes.h:1208
ProjectionInfo * ps_ProjInfo
Definition: execnodes.h:1199
bool scanopsfixed
Definition: execnodes.h:1237
bool async_capable
Definition: execnodes.h:1201
bool resultopsfixed
Definition: execnodes.h:1240
bool inneropsfixed
Definition: execnodes.h:1239
ExecProcNodeMtd ExecProcNode
Definition: execnodes.h:1165
OffsetNumber attno
Definition: execnodes.h:2377
FmgrInfo flinfo
Definition: execnodes.h:2375
FunctionCallInfo fcinfo
Definition: execnodes.h:2376
PlanState ps
Definition: execnodes.h:1377
MemoryContext argcontext
Definition: execnodes.h:1382
bool pending_srf_tuples
Definition: execnodes.h:1381
ExprDoneCond * elemdone
Definition: execnodes.h:1379
ExprState pi_state
Definition: execnodes.h:386
ExprContext * pi_exprContext
Definition: execnodes.h:388
NodeTag type
Definition: execnodes.h:384
MemoryContext tempContext
Definition: execnodes.h:1567
MemoryContext tableContext
Definition: execnodes.h:1569
Tuplestorestate * working_table
Definition: execnodes.h:1562
FmgrInfo * hashfunctions
Definition: execnodes.h:1566
Tuplestorestate * intermediate_table
Definition: execnodes.h:1563
TupleHashTable hashtable
Definition: execnodes.h:1568
TupleConversionMap * ri_RootToChildMap
Definition: execnodes.h: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:1363
bool rs_done
Definition: execnodes.h:1364
PlanState ps
Definition: execnodes.h:1362
bool rs_checkqual
Definition: execnodes.h:1365
NodeTag type
Definition: execnodes.h: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:1639
void * tsm_state
Definition: execnodes.h:1642
ScanState ss
Definition: execnodes.h:1637
struct TsmRoutine * tsmroutine
Definition: execnodes.h:1641
Relation ss_currentRelation
Definition: execnodes.h:1616
TupleTableSlot * ss_ScanTupleSlot
Definition: execnodes.h:1618
PlanState ps
Definition: execnodes.h:1615
struct TableScanDescData * ss_currentScanDesc
Definition: execnodes.h:1617
ScanState ss
Definition: execnodes.h:1627
Size pscan_len
Definition: execnodes.h:1628
Expr * expr
Definition: execnodes.h:936
FunctionCallInfo fcinfo
Definition: execnodes.h:996
TupleTableSlot * funcResultSlot
Definition: execnodes.h:959
Tuplestorestate * funcResultStore
Definition: execnodes.h:958
bool funcReturnsSet
Definition: execnodes.h:972
bool shutdown_reg
Definition: execnodes.h:989
bool funcReturnsTuple
Definition: execnodes.h:966
ExprState * elidedFuncState
Definition: execnodes.h:944
TupleDesc funcResultDesc
Definition: execnodes.h:965
FmgrInfo func
Definition: execnodes.h:951
List * args
Definition: execnodes.h:937
NodeTag type
Definition: execnodes.h:935
bool setArgsValid
Definition: execnodes.h:981
TupleTableSlot * nextTupleSlot
Definition: execnodes.h:2848
TupleTableSlot * firstTupleSlot
Definition: execnodes.h:2846
bool need_init
Definition: execnodes.h:2863
SortSupport sortKeys
Definition: execnodes.h:2860
TupleHashIterator hashiter
Definition: execnodes.h:2871
bool table_filled
Definition: execnodes.h:2870
SetOpStatePerInput rightInput
Definition: execnodes.h:2862
MemoryContext tableContext
Definition: execnodes.h:2869
PlanState ps
Definition: execnodes.h:2854
Oid * eqfuncoids
Definition: execnodes.h:2866
TupleHashTable hashtable
Definition: execnodes.h:2868
FmgrInfo * hashfunctions
Definition: execnodes.h:2867
SetOpStatePerInput leftInput
Definition: execnodes.h:2861
int64 numOutput
Definition: execnodes.h:2856
bool setop_done
Definition: execnodes.h:2855
AggregateInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:2503
BitmapHeapScanInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:1873
HashInstrumentation hinstrument[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:2802
IncrementalSortInfo sinfo[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:2436
MemoizeInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:2322
TuplesortInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]
Definition: execnodes.h:2387
bool sort_Done
Definition: execnodes.h:2400
bool am_worker
Definition: execnodes.h:2404
int64 bound_Done
Definition: execnodes.h:2402
bool bounded_Done
Definition: execnodes.h:2401
void * tuplesortstate
Definition: execnodes.h:2403
bool randomAccess
Definition: execnodes.h:2397
SharedSortInfo * shared_info
Definition: execnodes.h:2406
bool datumSort
Definition: execnodes.h:2405
ScanState ss
Definition: execnodes.h:2396
bool bounded
Definition: execnodes.h:2398
int64 bound
Definition: execnodes.h:2399
TupleHashTable hashtable
Definition: execnodes.h:1016
ExprState * lhs_hash_expr
Definition: execnodes.h:1029
PlanState * parent
Definition: execnodes.h:1008
ExprState * cur_eq_comp
Definition: execnodes.h:1031
MemoryContext hashtablecxt
Definition: execnodes.h:1020
Oid * tab_eq_funcoids
Definition: execnodes.h:1025
NodeTag type
Definition: execnodes.h:1005
ExprContext * innerecontext
Definition: execnodes.h:1021
FmgrInfo * tab_hash_funcs
Definition: execnodes.h:1028
FmgrInfo * cur_eq_funcs
Definition: execnodes.h:1030
PlanState * planstate
Definition: execnodes.h:1007
HeapTuple curTuple
Definition: execnodes.h:1010
AttrNumber * keyColIdx
Definition: execnodes.h:1024
TupleDesc descRight
Definition: execnodes.h:1013
SubPlan * subplan
Definition: execnodes.h:1006
ProjectionInfo * projLeft
Definition: execnodes.h:1014
ProjectionInfo * projRight
Definition: execnodes.h:1015
bool havenullrows
Definition: execnodes.h:1019
ExprState * testexpr
Definition: execnodes.h:1009
Oid * tab_collations
Definition: execnodes.h:1027
TupleHashTable hashnulls
Definition: execnodes.h:1017
bool havehashrows
Definition: execnodes.h:1018
Datum curArray
Definition: execnodes.h:1011
PlanState * subplan
Definition: execnodes.h:1948
MemoryContext perTableCxt
Definition: execnodes.h:2038
Tuplestorestate * tupstore
Definition: execnodes.h:2039
Bitmapset * notnulls
Definition: execnodes.h:2032
const struct TableFuncRoutine * routine
Definition: execnodes.h:2034
ExprState * rowexpr
Definition: execnodes.h:2025
FmgrInfo * in_functions
Definition: execnodes.h:2035
List * passingvalexprs
Definition: execnodes.h:2029
ExprState * docexpr
Definition: execnodes.h:2024
ItemPointerData trss_maxtid
Definition: execnodes.h:1934
List * trss_tidexprs
Definition: execnodes.h:1932
ItemPointerData trss_mintid
Definition: execnodes.h:1933
ScanState ss
Definition: execnodes.h:1912
bool tss_isCurrentOf
Definition: execnodes.h:1914
ItemPointerData * tss_TidList
Definition: execnodes.h:1917
List * tss_tidexprs
Definition: execnodes.h:1913
MinimalTuple firstTuple
Definition: execnodes.h:849
AttrNumber * keyColIdx
Definition: execnodes.h:866
tuplehash_hash * hashtab
Definition: execnodes.h:864
ExprState * in_hash_expr
Definition: execnodes.h:876
ExprState * tab_hash_expr
Definition: execnodes.h:867
MemoryContext tempcxt
Definition: execnodes.h:871
ExprState * tab_eq_func
Definition: execnodes.h:868
TupleTableSlot * tableslot
Definition: execnodes.h:873
ExprContext * exprcontext
Definition: execnodes.h:878
MemoryContext tablecxt
Definition: execnodes.h:870
TupleTableSlot * inputslot
Definition: execnodes.h:875
ExprState * cur_eq_func
Definition: execnodes.h:877
PlanState ps
Definition: execnodes.h:2723
ExprState * eqfunction
Definition: execnodes.h:2724
ScanState ss
Definition: execnodes.h:2007
List ** exprlists
Definition: execnodes.h:2009
List ** exprstatelists
Definition: execnodes.h:2010
ExprContext * rowcontext
Definition: execnodes.h:2008
ExprState * endOffset
Definition: execnodes.h:2652
MemoryContext aggcontext
Definition: execnodes.h:2682
ScanState ss
Definition: execnodes.h:2624
int64 aggregatedbase
Definition: execnodes.h:2646
int64 frametailgroup
Definition: execnodes.h:2677
int64 frameheadgroup
Definition: execnodes.h:2676
WindowStatePerAgg peragg
Definition: execnodes.h:2632
MemoryContext partcontext
Definition: execnodes.h:2681
FmgrInfo endInRangeFunc
Definition: execnodes.h:2658
TupleTableSlot * framehead_slot
Definition: execnodes.h:2701
bool next_partition
Definition: execnodes.h:2689
bool frametail_valid
Definition: execnodes.h:2694
bool partition_spooled
Definition: execnodes.h:2687
FmgrInfo startInRangeFunc
Definition: execnodes.h:2657
int64 spooled_rows
Definition: execnodes.h:2640
int64 frameheadpos
Definition: execnodes.h:2642
bool more_partitions
Definition: execnodes.h:2690
Datum startOffsetValue
Definition: execnodes.h:2653
int64 grouptailpos
Definition: execnodes.h:2679
int64 currentgroup
Definition: execnodes.h:2675
TupleTableSlot * frametail_slot
Definition: execnodes.h:2702
ExprState * ordEqfunction
Definition: execnodes.h:2634
ExprState * runcondition
Definition: execnodes.h:2669
TupleTableSlot * temp_slot_2
Definition: execnodes.h:2707
Tuplestorestate * buffer
Definition: execnodes.h:2635
WindowAggStatus status
Definition: execnodes.h:2648
TupleTableSlot * agg_row_slot
Definition: execnodes.h:2705
struct WindowObjectData * agg_winobj
Definition: execnodes.h:2645
WindowStatePerFunc perfunc
Definition: execnodes.h:2631
bool framehead_valid
Definition: execnodes.h:2692
int64 groupheadpos
Definition: execnodes.h:2678
MemoryContext curaggcontext
Definition: execnodes.h:2683
bool inRangeNullsFirst
Definition: execnodes.h:2661
bool grouptail_valid
Definition: execnodes.h:2696
Datum endOffsetValue
Definition: execnodes.h:2654
int64 currentpos
Definition: execnodes.h:2641
ExprState * partEqfunction
Definition: execnodes.h:2633
int64 frametailpos
Definition: execnodes.h:2643
ExprState * startOffset
Definition: execnodes.h:2651
TupleTableSlot * first_part_slot
Definition: execnodes.h:2699
int64 aggregatedupto
Definition: execnodes.h:2647
ExprContext * tmpcontext
Definition: execnodes.h:2684
TupleTableSlot * temp_slot_1
Definition: execnodes.h:2706
bool use_pass_through
Definition: execnodes.h:2664
WindowFunc * wfunc
Definition: execnodes.h:917
ExprState * aggfilter
Definition: execnodes.h:919
RecursiveUnionState * rustate
Definition: execnodes.h:2094
Definition: dsa.c:348
const char * type