execnodes.h

来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· C头文件 代码 · 共 1,396 行 · 第 1/4 页

H
1,396
字号
} RowCompareExprState;/* ---------------- *		CoalesceExprState node * ---------------- */typedef struct CoalesceExprState{	ExprState	xprstate;	List	   *args;			/* the arguments */} CoalesceExprState;/* ---------------- *		MinMaxExprState node * ---------------- */typedef struct MinMaxExprState{	ExprState	xprstate;	List	   *args;			/* the arguments */	FmgrInfo	cfunc;			/* lookup info for comparison func */} MinMaxExprState;/* ---------------- *		NullTestState node * ---------------- */typedef struct NullTestState{	ExprState	xprstate;	ExprState  *arg;			/* input expression */	bool		argisrow;		/* T if input is of a composite type */	/* used only if argisrow: */	TupleDesc	argdesc;		/* tupdesc for most recent input */} NullTestState;/* ---------------- *		CoerceToDomainState node * ---------------- */typedef struct CoerceToDomainState{	ExprState	xprstate;	ExprState  *arg;			/* input expression */	/* Cached list of constraints that need to be checked */	List	   *constraints;	/* list of DomainConstraintState nodes */} CoerceToDomainState;/* * DomainConstraintState - one item to check during CoerceToDomain * * Note: this is just a Node, and not an ExprState, because it has no * corresponding Expr to link to.  Nonetheless it is part of an ExprState * tree, so we give it a name following the xxxState convention. */typedef enum DomainConstraintType{	DOM_CONSTRAINT_NOTNULL,	DOM_CONSTRAINT_CHECK} DomainConstraintType;typedef struct DomainConstraintState{	NodeTag		type;	DomainConstraintType constrainttype;		/* constraint type */	char	   *name;			/* name of constraint (for error msgs) */	ExprState  *check_expr;		/* for CHECK, a boolean expression */} DomainConstraintState;/* ---------------------------------------------------------------- *				 Executor State Trees * * An executing query has a PlanState tree paralleling the Plan tree * that describes the plan. * ---------------------------------------------------------------- *//* ---------------- *		PlanState node * * We never actually instantiate any PlanState nodes; this is just the common * abstract superclass for all PlanState-type nodes. * ---------------- */typedef struct PlanState{	NodeTag		type;	Plan	   *plan;			/* associated Plan node */	EState	   *state;			/* at execution time, state's of individual								 * nodes point to one EState for the whole								 * top-level plan */	struct Instrumentation *instrument; /* Optional runtime stats for this										 * plan node */	/*	 * Common structural data for all Plan types.  These links to subsidiary	 * state trees parallel links in the associated plan tree (except for the	 * subPlan list, which does not exist in the plan tree).	 */	List	   *targetlist;		/* target list to be computed at this node */	List	   *qual;			/* implicitly-ANDed qual conditions */	struct PlanState *lefttree; /* input plan tree(s) */	struct PlanState *righttree;	List	   *initPlan;		/* Init SubPlanState nodes (un-correlated expr								 * subselects) */	List	   *subPlan;		/* SubPlanState nodes in my expressions */	/*	 * State for management of parameter-change-driven rescanning	 */	Bitmapset  *chgParam;		/* set of IDs of changed Params */	/*	 * Other run-time state needed by most if not all node types.	 */	TupleTableSlot *ps_OuterTupleSlot;	/* slot for current "outer" tuple */	TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */	ExprContext *ps_ExprContext;	/* node's expression-evaluation context */	ProjectionInfo *ps_ProjInfo;	/* info for doing tuple projection */	bool		ps_TupFromTlist;/* state flag for processing set-valued								 * functions in targetlist */} PlanState;/* ---------------- *	these are are defined to avoid confusion problems with "left" *	and "right" and "inner" and "outer".  The convention is that *	the "left" plan is the "outer" plan and the "right" plan is *	the inner plan, but these make the code more readable. * ---------------- */#define innerPlanState(node)		(((PlanState *)(node))->righttree)#define outerPlanState(node)		(((PlanState *)(node))->lefttree)/* ---------------- *	 ResultState information * ---------------- */typedef struct ResultState{	PlanState	ps;				/* its first field is NodeTag */	ExprState  *resconstantqual;	bool		rs_done;		/* are we done? */	bool		rs_checkqual;	/* do we need to check the qual? */} ResultState;/* ---------------- *	 AppendState information * *		nplans			how many plans are in the list *		whichplan		which plan is being executed (0 .. n-1) *		firstplan		first plan to execute (usually 0) *		lastplan		last plan to execute (usually n-1) * ---------------- */typedef struct AppendState{	PlanState	ps;				/* its first field is NodeTag */	PlanState **appendplans;	/* array of PlanStates for my inputs */	int			as_nplans;	int			as_whichplan;	int			as_firstplan;	int			as_lastplan;} AppendState;/* ---------------- *	 BitmapAndState information * ---------------- */typedef struct BitmapAndState{	PlanState	ps;				/* its first field is NodeTag */	PlanState **bitmapplans;	/* array of PlanStates for my inputs */	int			nplans;			/* number of input plans */} BitmapAndState;/* ---------------- *	 BitmapOrState information * ---------------- */typedef struct BitmapOrState{	PlanState	ps;				/* its first field is NodeTag */	PlanState **bitmapplans;	/* array of PlanStates for my inputs */	int			nplans;			/* number of input plans */} BitmapOrState;/* ---------------------------------------------------------------- *				 Scan State Information * ---------------------------------------------------------------- *//* ---------------- *	 ScanState information * *		ScanState extends PlanState for node types that represent *		scans of an underlying relation.  It can also be used for nodes *		that scan the output of an underlying plan node --- in that case, *		only ScanTupleSlot is actually useful, and it refers to the tuple *		retrieved from the subplan. * *		currentRelation    relation being scanned (NULL if none) *		currentScanDesc    current scan descriptor for scan (NULL if none) *		ScanTupleSlot	   pointer to slot in tuple table holding scan tuple * ---------------- */typedef struct ScanState{	PlanState	ps;				/* its first field is NodeTag */	Relation	ss_currentRelation;	HeapScanDesc ss_currentScanDesc;	TupleTableSlot *ss_ScanTupleSlot;} ScanState;/* * SeqScan uses a bare ScanState as its state node, since it needs * no additional fields. */typedef ScanState SeqScanState;/* * These structs store information about index quals that don't have simple * constant right-hand sides.  See comments for ExecIndexBuildScanKeys() * for discussion. */typedef struct{	ScanKey		scan_key;		/* scankey to put value into */	ExprState  *key_expr;		/* expr to evaluate to get value */} IndexRuntimeKeyInfo;typedef struct{	ScanKey		scan_key;		/* scankey to put value into */	ExprState  *array_expr;		/* expr to evaluate to get array value */	int			next_elem;		/* next array element to use */	int			num_elems;		/* number of elems in current array value */	Datum	   *elem_values;	/* array of num_elems Datums */	bool	   *elem_nulls;		/* array of num_elems is-null flags */} IndexArrayKeyInfo;/* ---------------- *	 IndexScanState information * *		indexqualorig	   execution state for indexqualorig expressions *		ScanKeys		   Skey structures to scan index rel *		NumScanKeys		   number of Skey structs *		RuntimeKeys		   info about Skeys that must be evaluated at runtime *		NumRuntimeKeys	   number of RuntimeKeys structs *		RuntimeKeysReady   true if runtime Skeys have been computed *		RuntimeContext	   expr context for evaling runtime Skeys *		RelationDesc	   index relation descriptor *		ScanDesc		   index scan descriptor * ---------------- */typedef struct IndexScanState{	ScanState	ss;				/* its first field is NodeTag */	List	   *indexqualorig;	ScanKey		iss_ScanKeys;	int			iss_NumScanKeys;	IndexRuntimeKeyInfo *iss_RuntimeKeys;	int			iss_NumRuntimeKeys;	bool		iss_RuntimeKeysReady;	ExprContext *iss_RuntimeContext;	Relation	iss_RelationDesc;	IndexScanDesc iss_ScanDesc;} IndexScanState;/* ---------------- *	 BitmapIndexScanState information * *		result			   bitmap to return output into, or NULL *		ScanKeys		   Skey structures to scan index rel *		NumScanKeys		   number of Skey structs *		RuntimeKeys		   info about Skeys that must be evaluated at runtime *		NumRuntimeKeys	   number of RuntimeKeys structs *		ArrayKeys		   info about Skeys that come from ScalarArrayOpExprs *		NumArrayKeys	   number of ArrayKeys structs *		RuntimeKeysReady   true if runtime Skeys have been computed *		RuntimeContext	   expr context for evaling runtime Skeys *		RelationDesc	   index relation descriptor *		ScanDesc		   index scan descriptor * ---------------- */typedef struct BitmapIndexScanState{	ScanState	ss;				/* its first field is NodeTag */	TIDBitmap  *biss_result;	ScanKey		biss_ScanKeys;	int			biss_NumScanKeys;	IndexRuntimeKeyInfo *biss_RuntimeKeys;	int			biss_NumRuntimeKeys;	IndexArrayKeyInfo *biss_ArrayKeys;	int			biss_NumArrayKeys;	bool		biss_RuntimeKeysReady;	ExprContext *biss_RuntimeContext;	Relation	biss_RelationDesc;	IndexScanDesc biss_ScanDesc;} BitmapIndexScanState;/* ---------------- *	 BitmapHeapScanState information * *		bitmapqualorig	   execution state for bitmapqualorig expressions *		tbm				   bitmap obtained from child index scan(s) *		tbmres			   current-page data * ---------------- */typedef struct BitmapHeapScanState{	ScanState	ss;				/* its first field is NodeTag */	List	   *bitmapqualorig;	TIDBitmap  *tbm;	TBMIterateResult *tbmres;} BitmapHeapScanState;/* ---------------- *	 TidScanState information * *		NumTids		   number of tids in this scan *		TidPtr		   index of currently fetched tid *		TidList		   evaluated item pointers (array of size NumTids) * ---------------- */typedef struct TidScanState{	ScanState	ss;				/* its first field is NodeTag */	List	   *tss_tidquals;	/* list of ExprState nodes */	int			tss_NumTids;	int			tss_TidPtr;	int			tss_MarkTidPtr;	ItemPointerData *tss_TidList;	HeapTupleData tss_htup;} TidScanState;/* ---------------- *	 SubqueryScanState information * *		SubqueryScanState is used for scanning a sub-query in the range table. *		The sub-query will have its own EState, which we save here. *		ScanTupleSlot references the current output tuple of the sub-query. * *		SubEState		   exec state for sub-query * ----------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?