您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ExecInitResultTupleSlot函数代码示例

51自学网 2021-06-01 20:39:41
  C++
这篇教程C++ ExecInitResultTupleSlot函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ExecInitResultTupleSlot函数的典型用法代码示例。如果您正苦于以下问题:C++ ExecInitResultTupleSlot函数的具体用法?C++ ExecInitResultTupleSlot怎么用?C++ ExecInitResultTupleSlot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ExecInitResultTupleSlot函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ExecInitSeqScan

/* ---------------------------------------------------------------- *		ExecInitSeqScan * ---------------------------------------------------------------- */SeqScanState *ExecInitSeqScan(SeqScan *node, EState *estate, int eflags){	SeqScanState *scanstate;	AttrNumber ctid_attrno;	/*	 * Once upon a time it was possible to have an outerPlan of a SeqScan, but	 * not any more.	 */	Assert(outerPlan(node) == NULL);	Assert(innerPlan(node) == NULL);	/*	 * create state structure	 */	scanstate = makeNode(SeqScanState);	scanstate->ps.plan = (Plan *) node;	scanstate->ps.state = estate;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &scanstate->ps);	/*	 * initialize child expressions	 */	scanstate->ps.targetlist = (List *)		ExecInitExpr((Expr *) node->plan.targetlist,					 (PlanState *) scanstate);	scanstate->ps.qual = (List *)		ExecInitExpr((Expr *) node->plan.qual,					 (PlanState *) scanstate);#define SEQSCAN_NSLOTS 2	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &scanstate->ps);	ExecInitScanTupleSlot(estate, scanstate);	/*	 * initialize scan relation	 */	InitScanRelation(scanstate, estate);	scanstate->ps.ps_TupFromTlist = false;	/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&scanstate->ps);	ExecAssignScanProjectionInfo(scanstate);	return scanstate;}
开发者ID:kvap,项目名称:postgres-pq,代码行数:64,


示例2: ExecInitUnique

/* ---------------------------------------------------------------- *		ExecInitUnique * *		This initializes the unique node state structures and *		the node's subplan. * ---------------------------------------------------------------- */UniqueState *ExecInitUnique(Unique *node, EState *estate, int eflags){	UniqueState *uniquestate;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * create state structure	 */	uniquestate = makeNode(UniqueState);	uniquestate->ps.plan = (Plan *) node;	uniquestate->ps.state = estate;	/*	 * Miscellaneous initialization	 *	 * Unique nodes have no ExprContext initialization because they never call	 * ExecQual or ExecProject.  But they do need a per-tuple memory context	 * anyway for calling execTuplesMatch.	 */	uniquestate->tempContext =		AllocSetContextCreate(CurrentMemoryContext,							  "Unique",							  ALLOCSET_DEFAULT_MINSIZE,							  ALLOCSET_DEFAULT_INITSIZE,							  ALLOCSET_DEFAULT_MAXSIZE);#define UNIQUE_NSLOTS 1	/*	 * Tuple table initialization	 */	ExecInitResultTupleSlot(estate, &uniquestate->ps);	/*	 * then initialize outer plan	 */	outerPlanState(uniquestate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * unique nodes do no projections, so initialize projection info for this	 * node appropriately	 */	ExecAssignResultTypeFromTL(&uniquestate->ps);	uniquestate->ps.ps_ProjInfo = NULL;	/*	 * Precompute fmgr lookup data for inner loop	 */	uniquestate->eqfunctions =		execTuplesMatchPrepare(ExecGetResultType(&uniquestate->ps),							   node->numCols,							   node->uniqColIdx);	initGpmonPktForUnique((Plan *)node, &uniquestate->ps.gpmon_pkt, estate);		return uniquestate;}
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:67,


示例3: ExecInitWorkTableScan

/* ---------------------------------------------------------------- *		ExecInitWorkTableScan * ---------------------------------------------------------------- */WorkTableScanState *ExecInitWorkTableScan(WorkTableScan *node, EState *estate, int eflags){	WorkTableScanState *scanstate;	/* check for unsupported flags */	/*	 * GPDB_84_MERGE_FIXME: Make sure we don't require EXEC_FLAG_BACKWARD	 * in GPDB.	 */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * WorkTableScan should not have any children.	 */	Assert(outerPlan(node) == NULL);	Assert(innerPlan(node) == NULL);	/*	 * create new WorkTableScanState for node	 */	scanstate = makeNode(WorkTableScanState);	scanstate->ss.ps.plan = (Plan *) node;	scanstate->ss.ps.state = estate;	scanstate->rustate = NULL;	/* we'll set this later */	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &scanstate->ss.ps);	/*	 * initialize child expressions	 */	scanstate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) scanstate);	scanstate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) scanstate);#define WORKTABLESCAN_NSLOTS 2	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &scanstate->ss.ps);	ExecInitScanTupleSlot(estate, &scanstate->ss);	/*	 * Initialize result tuple type, but not yet projection info.	 */	ExecAssignResultTypeFromTL(&scanstate->ss.ps);	/* scanstate->ss.ps.ps_TupFromTlist = false; */	return scanstate;}
开发者ID:PengJi,项目名称:gpdb-comments,代码行数:64,


示例4: ExecInitAppendOnlyScan

/* ---------------------------------------------------------------- *		ExecInitAppendOnlyScan * ---------------------------------------------------------------- */AppendOnlyScanState *ExecInitAppendOnlyScan(AppendOnlyScan *node, EState *estate, int eflags){	AppendOnlyScanState	*appendonlystate;	Relation			currentRelation;		Assert(outerPlan(node) == NULL);	Assert(innerPlan(node) == NULL);	/*	 * create state structure	 */	appendonlystate = makeNode(AppendOnlyScanState);	appendonlystate->ss.ps.plan = (Plan *) node;	appendonlystate->ss.ps.state = estate;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &appendonlystate->ss.ps);	/*	 * initialize child expressions	 */	appendonlystate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) appendonlystate);	appendonlystate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) appendonlystate);#define AOSCAN_NSLOTS 2	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &appendonlystate->ss.ps);	ExecInitScanTupleSlot(estate, &appendonlystate->ss);	/*	 * get the relation object id from the relid'th entry in the range table	 * and open that relation.	 */	currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid);		appendonlystate->ss.ss_currentRelation = currentRelation;	ExecAssignScanType(&appendonlystate->ss, RelationGetDescr(currentRelation));		/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&appendonlystate->ss.ps);	ExecAssignScanProjectionInfo(&appendonlystate->ss);	initGpmonPktForAppendOnlyScan((Plan *)node, &appendonlystate->ss.ps.gpmon_pkt, estate);	return appendonlystate;}
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:63,


示例5: ExecInitResult

/* ---------------------------------------------------------------- *		ExecInitResult * *		Creates the run-time state information for the result node *		produced by the planner and initailizes outer relations *		(child nodes). * ---------------------------------------------------------------- */ResultState *ExecInitResult(Result *node, EState *estate){	ResultState *resstate;	/*	 * create state structure	 */	resstate = makeNode(ResultState);	resstate->ps.plan = (Plan *) node;	resstate->ps.state = estate;	resstate->rs_done = false;	resstate->rs_checkqual = (node->resconstantqual == NULL) ? false : true;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &resstate->ps);#define RESULT_NSLOTS 1	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &resstate->ps);	/*	 * initialize child expressions	 */	resstate->ps.targetlist = (List *)		ExecInitExpr((Expr *) node->plan.targetlist,					 (PlanState *) resstate);	resstate->ps.qual = (List *)		ExecInitExpr((Expr *) node->plan.qual,					 (PlanState *) resstate);	resstate->resconstantqual = ExecInitExpr((Expr *) node->resconstantqual,											 (PlanState *) resstate);	/*	 * initialize child nodes	 */	outerPlanState(resstate) = ExecInitNode(outerPlan(node), estate);	/*	 * we don't use inner plan	 */	Assert(innerPlan(node) == NULL);	/*	 * initialize tuple type and projection info	 */	ExecAssignResultTypeFromTL(&resstate->ps);	ExecAssignProjectionInfo(&resstate->ps);	return resstate;}
开发者ID:alecclarke,项目名称:postgresql-8.1.4,代码行数:67,


示例6: ExecInitGroup

/* ----------------- * ExecInitGroup * *	Creates the run-time information for the group node produced by the *	planner and initializes its outer subtree * ----------------- */GroupState *ExecInitGroup(Group *node, EState *estate, int eflags){	GroupState *grpstate;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * create state structure	 */	grpstate = makeNode(GroupState);	grpstate->ss.ps.plan = (Plan *) node;	grpstate->ss.ps.state = estate;	grpstate->ss.ps.ExecProcNode = ExecGroup;	grpstate->grp_done = false;	/*	 * create expression context	 */	ExecAssignExprContext(estate, &grpstate->ss.ps);	/*	 * tuple table initialization	 */	ExecInitScanTupleSlot(estate, &grpstate->ss);	ExecInitResultTupleSlot(estate, &grpstate->ss.ps);	/*	 * initialize child expressions	 */	grpstate->ss.ps.qual =		ExecInitQual(node->plan.qual, (PlanState *) grpstate);	/*	 * initialize child nodes	 */	outerPlanState(grpstate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * initialize tuple type.	 */	ExecAssignScanTypeFromOuterPlan(&grpstate->ss);	/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&grpstate->ss.ps);	ExecAssignProjectionInfo(&grpstate->ss.ps, NULL);	/*	 * Precompute fmgr lookup data for inner loop	 */	grpstate->eqfunctions =		execTuplesMatchPrepare(node->numCols,							   node->grpOperators);	return grpstate;}
开发者ID:maksm90,项目名称:postgresql,代码行数:66,


示例7: ExecInitDML

/** * Init nodeDML, which initializes the insert TupleTableSlot. * */DMLState*ExecInitDML(DML *node, EState *estate, int eflags){		/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK | EXEC_FLAG_REWIND)));		DMLState *dmlstate = makeNode(DMLState);	dmlstate->ps.plan = (Plan *)node;	dmlstate->ps.state = estate;	ExecInitResultTupleSlot(estate, &dmlstate->ps);	dmlstate->ps.targetlist = (List *)						ExecInitExpr((Expr *) node->plan.targetlist,						(PlanState *) dmlstate);	Plan *outerPlan  = outerPlan(node);	outerPlanState(dmlstate) = ExecInitNode(outerPlan, estate, eflags);	ExecAssignResultTypeFromTL(&dmlstate->ps);	/* Create expression evaluation context. This will be used for projections */	ExecAssignExprContext(estate, &dmlstate->ps);	/*	 * Create projection info from the child tuple descriptor and our target list	 * Projection will be placed in the ResultSlot	 */	TupleTableSlot *childResultSlot = outerPlanState(dmlstate)->ps_ResultTupleSlot;	ExecAssignProjectionInfo(&dmlstate->ps, childResultSlot->tts_tupleDescriptor);		/*	 * Initialize slot to insert/delete using output relation descriptor.	 */	dmlstate->cleanedUpSlot = ExecInitExtraTupleSlot(estate);	/*	 * Both input and output of the junk filter include dropped attributes, so	 * the junk filter doesn't need to do anything special there about them	 */	TupleDesc cleanTupType = CreateTupleDescCopy(dmlstate->ps.state->es_result_relation_info->ri_RelationDesc->rd_att); 	dmlstate->junkfilter = ExecInitJunkFilter(node->plan.targetlist,			cleanTupType,			dmlstate->cleanedUpSlot);	if (estate->es_instrument)	{	        dmlstate->ps.cdbexplainbuf = makeStringInfo();	        /* Request a callback at end of query. */	        dmlstate->ps.cdbexplainfun = ExecDMLExplainEnd;	}	initGpmonPktForDML((Plan *)node, &dmlstate->ps.gpmon_pkt, estate);		return dmlstate;}
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:61,


示例8: ExecInitHash

/* ---------------------------------------------------------------- *		ExecInitHash * *		Init routine for Hash node * ---------------------------------------------------------------- */HashState *ExecInitHash(Hash *node, EState *estate, int eflags){	HashState  *hashstate;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * create state structure	 */	hashstate = makeNode(HashState);	hashstate->ps.plan = (Plan *) node;	hashstate->ps.state = estate;	hashstate->hashtable = NULL;	hashstate->hashkeys = NIL;	/* will be set by parent HashJoin */	/*CHANGED BY YASIN*/	if (eflags & EXEC_FLAG_INAROUND) hashstate->ps.ps_InAround = true;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &hashstate->ps);#define HASH_NSLOTS 1	/*	 * initialize our result slot	 */	ExecInitResultTupleSlot(estate, &hashstate->ps);	/*	 * initialize child expressions	 */	hashstate->ps.targetlist = (List *)		ExecInitExpr((Expr *) node->plan.targetlist,					 (PlanState *) hashstate);	hashstate->ps.qual = (List *)		ExecInitExpr((Expr *) node->plan.qual,					 (PlanState *) hashstate);	/*	 * initialize child nodes	 */	outerPlanState(hashstate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * initialize tuple type. no need to initialize projection info because	 * this node doesn't do projections	 */	ExecAssignResultTypeFromTL(&hashstate->ps);	hashstate->ps.ps_ProjInfo = NULL;	return hashstate;}
开发者ID:merlintang,项目名称:sgb,代码行数:64,


示例9: ExecInitHash

/* ---------------------------------------------------------------- *   	ExecInitHash * *   	Init routine for Hash node * ---------------------------------------------------------------- */boolExecInitHash(Hash *node, EState *estate, Plan *parent){    HashState		*hashstate;    Plan		*outerPlan;        SO1_printf("ExecInitHash: %s/n",	       "initializing hash node");        /* ----------------     *  assign the node's execution state     * ----------------     */    node->plan.state = estate;        /* ----------------     * create state structure     * ----------------     */    hashstate = makeNode(HashState);    node->hashstate = hashstate;    hashstate->hashBatches = NULL;        /* ----------------     *  Miscellanious initialization     *     *	     +	assign node's base_id     *       +	assign debugging hooks and     *       +	create expression context for node     * ----------------     */    ExecAssignNodeBaseInfo(estate, &hashstate->cstate, parent);    ExecAssignExprContext(estate, &hashstate->cstate);    #define HASH_NSLOTS 1    /* ----------------     * initialize our result slot     * ----------------     */    ExecInitResultTupleSlot(estate, &hashstate->cstate);        /* ----------------     * initializes child nodes     * ----------------     */    outerPlan = outerPlan(node);    ExecInitNode(outerPlan, estate, (Plan *)node);        /* ----------------     * 	initialize tuple type. no need to initialize projection     *  info because this node doesn't do projections     * ----------------     */    ExecAssignResultTypeFromOuterPlan((Plan *) node, &hashstate->cstate);    hashstate->cstate.cs_ProjInfo = NULL;        return TRUE;}
开发者ID:jarulraj,项目名称:postgres95,代码行数:64,


示例10: ExecInitLimit

/* ---------------------------------------------------------------- *		ExecInitLimit * *		This initializes the limit node state structures and *		the node's subplan. * ---------------------------------------------------------------- */LimitState *ExecInitLimit(Limit *node, EState *estate, int eflags){	LimitState *limitstate;	Plan	   *outerPlan;	/* check for unsupported flags */	Assert(!(eflags & EXEC_FLAG_MARK));	/*	 * create state structure	 */	limitstate = makeNode(LimitState);	limitstate->ps.plan = (Plan *) node;	limitstate->ps.state = estate;	limitstate->lstate = LIMIT_INITIAL;	/*	 * Miscellaneous initialization	 *	 * Limit nodes never call ExecQual or ExecProject, but they need an	 * exprcontext anyway to evaluate the limit/offset parameters in.	 */	ExecAssignExprContext(estate, &limitstate->ps);	/*	 * initialize child expressions	 */	limitstate->limitOffset = ExecInitExpr((Expr *) node->limitOffset,										   (PlanState *) limitstate);	limitstate->limitCount = ExecInitExpr((Expr *) node->limitCount,										  (PlanState *) limitstate);#define LIMIT_NSLOTS 1	/*	 * Tuple table initialization (XXX not actually used...)	 */	ExecInitResultTupleSlot(estate, &limitstate->ps);	/*	 * then initialize outer plan	 */	outerPlan = outerPlan(node);	outerPlanState(limitstate) = ExecInitNode(outerPlan, estate, eflags);	/*	 * limit nodes do no projections, so initialize projection info for this	 * node appropriately	 */	ExecAssignResultTypeFromTL(&limitstate->ps);	limitstate->ps.ps_ProjInfo = NULL;	initGpmonPktForLimit((Plan *)node, &limitstate->ps.gpmon_pkt, estate);		return limitstate;}
开发者ID:50wu,项目名称:gpdb,代码行数:65,


示例11: ExecInitHash

/* ---------------------------------------------------------------- *		ExecInitHash * *		Init routine for Hash node * ---------------------------------------------------------------- */HashState *ExecInitHash(Hash *node, EState *estate){	HashState  *hashstate;	SO_printf("ExecInitHash: initializing hash node/n");	/*	 * create state structure	 */	hashstate = makeNode(HashState);	hashstate->ps.plan = (Plan *) node;	hashstate->ps.state = estate;	hashstate->hashtable = NULL;	hashstate->hashkeys = NIL;	/* will be set by parent HashJoin */	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &hashstate->ps);#define HASH_NSLOTS 1	/*	 * initialize our result slot	 */	ExecInitResultTupleSlot(estate, &hashstate->ps);	/*	 * initialize child expressions	 */	hashstate->ps.targetlist = (List *)		ExecInitExpr((Expr *) node->plan.targetlist,					 (PlanState *) hashstate);	hashstate->ps.qual = (List *)		ExecInitExpr((Expr *) node->plan.qual,					 (PlanState *) hashstate);	/*	 * initialize child nodes	 */	outerPlanState(hashstate) = ExecInitNode(outerPlan(node), estate);	/*	 * initialize tuple type. no need to initialize projection info	 * because this node doesn't do projections	 */	ExecAssignResultTypeFromOuterPlan(&hashstate->ps);	hashstate->ps.ps_ProjInfo = NULL;	return hashstate;}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:60,


示例12: ExecInitLimit

/* ---------------------------------------------------------------- *		ExecInitLimit * *		This initializes the limit node state structures and *		the node's subplan. * ---------------------------------------------------------------- */LimitState *ExecInitLimit(Limit *node, EState *estate){	LimitState *limitstate;	Plan	   *outerPlan;	/*	 * create state structure	 */	limitstate = makeNode(LimitState);	limitstate->ps.plan = (Plan *) node;	limitstate->ps.state = estate;	limitstate->lstate = LIMIT_INITIAL;	/*	 * Miscellaneous initialization	 *	 * Limit nodes never call ExecQual or ExecProject, but they need an	 * exprcontext anyway to evaluate the limit/offset parameters in.	 */	ExecAssignExprContext(estate, &limitstate->ps);	/*	 * initialize child expressions	 */	limitstate->limitOffset = ExecInitExpr((Expr *) node->limitOffset,										   (PlanState *) limitstate);	limitstate->limitCount = ExecInitExpr((Expr *) node->limitCount,										  (PlanState *) limitstate);#define LIMIT_NSLOTS 1	/*	 * Tuple table initialization	 */	ExecInitResultTupleSlot(estate, &limitstate->ps);	/*	 * then initialize outer plan	 */	outerPlan = outerPlan(node);	outerPlanState(limitstate) = ExecInitNode(outerPlan, estate);	/*	 * limit nodes do no projections, so initialize projection info for	 * this node appropriately	 */	ExecAssignResultTypeFromOuterPlan(&limitstate->ps);	limitstate->ps.ps_ProjInfo = NULL;	return limitstate;}
开发者ID:sunyangkobe,项目名称:cscd43,代码行数:60,


示例13: ExecInitSeqScan

/* ---------------------------------------------------------------- *		ExecInitSeqScan * ---------------------------------------------------------------- */SeqScanState *ExecInitSeqScan(SeqScan *node, EState *estate, int eflags){	SeqScanState *scanstate;	/*	 * Once upon a time it was possible to have an outerPlan of a SeqScan, but	 * not any more.	 */	Assert(outerPlan(node) == NULL);	Assert(innerPlan(node) == NULL);	/*	 * create state structure	 */	scanstate = makeNode(SeqScanState);	scanstate->ss.ps.plan = (Plan *) node;	scanstate->ss.ps.state = estate;	scanstate->ss.ps.ExecProcNode = ExecSeqScan;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &scanstate->ss.ps);	/*	 * initialize child expressions	 */	scanstate->ss.ps.qual =		ExecInitQual(node->plan.qual, (PlanState *) scanstate);	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &scanstate->ss.ps);	ExecInitScanTupleSlot(estate, &scanstate->ss);	/*	 * initialize scan relation	 */	InitScanRelation(scanstate, estate, eflags);	/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&scanstate->ss.ps);	ExecAssignScanProjectionInfo(&scanstate->ss);	return scanstate;}
开发者ID:BertrandAreal,项目名称:postgres,代码行数:56,


示例14: ExecInitHash

/* ---------------------------------------------------------------- *		ExecInitHash * *		Init routine for Hash node * ---------------------------------------------------------------- */HashState *ExecInitHash(Hash *node, EState *estate, int eflags){	HashState  *hashstate;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * create state structure	 */	hashstate = makeNode(HashState);	hashstate->ps.plan = (Plan *) node;	hashstate->ps.state = estate;	hashstate->ps.ExecProcNode = ExecHash;	hashstate->hashtable = NULL;	hashstate->hashkeys = NIL;	/* will be set by parent HashJoin */	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &hashstate->ps);	/*	 * initialize our result slot	 */	ExecInitResultTupleSlot(estate, &hashstate->ps);	/*	 * initialize child expressions	 */	hashstate->ps.qual =		ExecInitQual(node->plan.qual, (PlanState *) hashstate);	/*	 * initialize child nodes	 */	outerPlanState(hashstate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * initialize tuple type. no need to initialize projection info because	 * this node doesn't do projections	 */	ExecAssignResultTypeFromTL(&hashstate->ps);	hashstate->ps.ps_ProjInfo = NULL;	return hashstate;}
开发者ID:bitnine-oss,项目名称:agens-graph,代码行数:56,


示例15: ExecInitMaterial

/* ---------------------------------------------------------------- *		ExecInitMaterial * ---------------------------------------------------------------- */MaterialState *ExecInitMaterial(Material *node, EState *estate){	MaterialState *matstate;	Plan	   *outerPlan;	/*	 * create state structure	 */	matstate = makeNode(MaterialState);	matstate->ss.ps.plan = (Plan *) node;	matstate->ss.ps.state = estate;	matstate->tuplestorestate = NULL;	matstate->eof_underlying = false;	/*	 * Miscellaneous initialization	 *	 * Materialization nodes don't need ExprContexts because they never call	 * ExecQual or ExecProject.	 */#define MATERIAL_NSLOTS 2	/*	 * tuple table initialization	 *	 * material nodes only return tuples from their materialized relation.	 */	ExecInitResultTupleSlot(estate, &matstate->ss.ps);	ExecInitScanTupleSlot(estate, &matstate->ss);	/*	 * initializes child nodes	 */	outerPlan = outerPlan(node);	outerPlanState(matstate) = ExecInitNode(outerPlan, estate);	/*	 * initialize tuple type.  no need to initialize projection info because	 * this node doesn't do projections.	 */	ExecAssignResultTypeFromTL(&matstate->ss.ps);	ExecAssignScanTypeFromOuterPlan(&matstate->ss);	matstate->ss.ps.ps_ProjInfo = NULL;	return matstate;}
开发者ID:CraigBryan,项目名称:PostgresqlFun,代码行数:53,


示例16: InitScanStateInternal

/* * InitScanStateInternal *   Initialize ScanState common variables for various Scan node. */voidInitScanStateInternal(ScanState *scanState, Plan *plan, EState *estate,		int eflags, bool initCurrentRelation){	Assert(IsA(plan, SeqScan) ||		   IsA(plan, AppendOnlyScan) ||		   IsA(plan, ParquetScan) ||		   IsA(plan, TableScan) ||		   IsA(plan, DynamicTableScan) ||		   IsA(plan, BitmapTableScan));	PlanState *planState = &scanState->ps;	planState->plan = plan;	planState->state = estate;	/* Create expression evaluation context */	ExecAssignExprContext(estate, planState);		/* Initialize tuple table slot */	ExecInitResultTupleSlot(estate, planState);	ExecInitScanTupleSlot(estate, scanState);		/*	 * For dynamic table scan, We do not initialize expression states; instead	 * we wait until the first partition, and initialize the expression state	 * at that time. Also, for dynamic table scan, we do not need to open the	 * parent partition relation.	 */	if (initCurrentRelation)	{		InitScanStateRelationDetails(scanState, plan, estate);	}	/* Initialize result tuple type. */	ExecAssignResultTypeFromTL(planState);	/*	 * If eflag contains EXEC_FLAG_REWIND or EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK,	 * then this node is not eager free safe.	 */	scanState->ps.delayEagerFree =		((eflags & (EXEC_FLAG_REWIND | EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)) != 0);	/* Currently, only SeqScan supports Mark/Restore. */	AssertImply((eflags & EXEC_FLAG_MARK) != 0, IsA(plan, SeqScan));}
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:52,


示例17: ExecInitRepeat

RepeatState *ExecInitRepeat(Repeat *node, EState *estate, int eflags){	RepeatState *repeatstate;	/* Check for unsupported flag */	Assert(!(eflags & (EXEC_FLAG_MARK | EXEC_FLAG_BACKWARD)) ||		   outerPlan(node) != NULL);	/*	 * Create state structure.	 */	repeatstate = makeNode(RepeatState);	repeatstate->ps.plan = (Plan *)node;	repeatstate->ps.state = estate;	/* Create expression context for the node. */	ExecAssignExprContext(estate, &repeatstate->ps);		ExecInitResultTupleSlot(estate, &repeatstate->ps);		/* Initialize child expressions */	repeatstate->ps.targetlist = (List *)		ExecInitExpr((Expr *)node->plan.targetlist,					 (PlanState *)repeatstate);	repeatstate->ps.qual = (List *)		ExecInitExpr((Expr *)node->plan.qual,					 (PlanState *)repeatstate);	repeatstate->expr_state =		ExecInitExpr(node->repeatCountExpr,					 (PlanState *)repeatstate);	/* Initialize child nodes */	outerPlanState(repeatstate) = ExecInitNode(outerPlan(node), estate, eflags);	/* Inner plan is not used. */	Assert(innerPlan(node) == NULL);		/* Initialize tuple type and projection info */	ExecAssignResultTypeFromTL(&repeatstate->ps);	ExecAssignProjectionInfo(&repeatstate->ps, NULL);	init_RepeatState(repeatstate);		initGpmonPktForRepeat((Plan *)node, &repeatstate->ps.gpmon_pkt, estate);		return repeatstate;}
开发者ID:50wu,项目名称:gpdb,代码行数:48,


示例18: ExecInitPartitionSelector

/* ---------------------------------------------------------------- *		ExecInitPartitionSelector * *		Create the run-time state information for PartitionSelector node *		produced by Orca and initializes outer child if exists. * * ---------------------------------------------------------------- */PartitionSelectorState *ExecInitPartitionSelector(PartitionSelector *node, EState *estate, int eflags){	/* check for unsupported flags */	Assert (!(eflags & (EXEC_FLAG_MARK | EXEC_FLAG_BACKWARD)));	PartitionSelectorState *psstate = initPartitionSelection(node, estate);	/* tuple table initialization */	ExecInitResultTupleSlot(estate, &psstate->ps);	ExecAssignResultTypeFromTL(&psstate->ps);	ExecAssignProjectionInfo(&psstate->ps, NULL);	/* initialize child nodes */	/* No inner plan for PartitionSelector */	Assert(NULL == innerPlan(node));	if (NULL != outerPlan(node))	{		outerPlanState(psstate) = ExecInitNode(outerPlan(node), estate, eflags);	}	/*	 * Initialize projection, to produce a tuple that has the partitioning key	 * columns at the same positions as in the partitioned table.	 */	if (node->partTabTargetlist)	{		List	   *exprStates;		exprStates = (List *) ExecInitExpr((Expr *) node->partTabTargetlist,										   (PlanState *) psstate);		psstate->partTabDesc = ExecTypeFromTL(node->partTabTargetlist, false);		psstate->partTabSlot = MakeSingleTupleTableSlot(psstate->partTabDesc);		psstate->partTabProj = ExecBuildProjectionInfo(exprStates,													   psstate->ps.ps_ExprContext,													   psstate->partTabSlot,													   ExecGetResultType(&psstate->ps));	}	initGpmonPktForPartitionSelector((Plan *)node, &psstate->ps.gpmon_pkt, estate);	return psstate;}
开发者ID:phan-pivotal,项目名称:gpdb,代码行数:52,


示例19: ExecInitTuplestoreScan

extern TuplestoreScanState *ExecInitTuplestoreScan(TuplestoreScan *node, EState *estate, int eflags){	TuplestoreScanState *tss = makeNode(TuplestoreScanState);	tss->ss.ps.plan = (Plan *) node;	tss->ss.ps.state = estate;	tss->ss.ps.ps_ExprContext = CreateExprContext(estate);	ExecInitResultTupleSlot(estate, &tss->ss.ps);	ExecInitScanTupleSlot(estate, &tss->ss);	ExecSetSlotDescriptor(tss->ss.ss_ScanTupleSlot, node->desc);	ExecSetSlotDescriptor(tss->ss.ps.ps_ResultTupleSlot, node->desc);	tss->ss.ps.targetlist = node->scan.plan.targetlist;	tuplestore_rescan(node->store);	return tss;}
开发者ID:jberkus,项目名称:pipelinedb,代码行数:20,


示例20: ExecInitTwice

TwiceState *ExecInitTwice(Twice *node, EState *estate, int eflags){	TwiceState *twicestate;	/*	 * create state structure	 */	twicestate = makeNode(TwiceState);	twicestate->ps.plan = (Plan *) node;	twicestate->ps.state = estate;	/*	 * Tuple table initialization	 */	ExecInitResultTupleSlot(estate, &twicestate->ps);	/*	 * then initialize outer plan	 */	outerPlanState(twicestate) = ExecInitNode(outerPlan(node),											  estate,											  eflags);	/*	 * twice nodes do no projections, so initialize projection info for this	 * node appropriately, i.e. keep all attributes as they are.	 */	ExecAssignResultTypeFromTL(&twicestate->ps);	twicestate->ps.ps_ProjInfo = NULL;	/*	 * Set output counter for each tuple to zero, s.t. we know that it is the	 * first output overall.	 */	twicestate->isFirst = true;	return twicestate;}
开发者ID:Piiit,项目名称:postgres-twice-patch,代码行数:39,


示例21: ExecInitIndexScan

/* ---------------------------------------------------------------- *		ExecInitIndexScan * *		Initializes the index scan's state information, creates *		scan keys, and opens the base and index relations. * *		Note: index scans have 2 sets of state information because *			  we have to keep track of the base relation and the *			  index relation. * ---------------------------------------------------------------- */IndexScanState *ExecInitIndexScan(IndexScan *node, EState *estate, int eflags){	IndexScanState *indexstate;	Relation	currentRelation;	bool		relistarget;	/*	 * create state structure	 */	indexstate = makeNode(IndexScanState);	indexstate->ss.ps.plan = (Plan *) node;	indexstate->ss.ps.state = estate;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &indexstate->ss.ps);	indexstate->ss.ps.ps_TupFromTlist = false;	/*	 * initialize child expressions	 *	 * Note: we don't initialize all of the indexqual expression, only the	 * sub-parts corresponding to runtime keys (see below).  Likewise for	 * indexorderby, if any.  But the indexqualorig expression is always	 * initialized even though it will only be used in some uncommon cases ---	 * would be nice to improve that.  (Problem is that any SubPlans present	 * in the expression must be found now...)	 */	indexstate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) indexstate);	indexstate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) indexstate);	indexstate->indexqualorig = (List *)		ExecInitExpr((Expr *) node->indexqualorig,					 (PlanState *) indexstate);	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &indexstate->ss.ps);	ExecInitScanTupleSlot(estate, &indexstate->ss);	/*	 * open the base relation and acquire appropriate lock on it.	 */	currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid);	indexstate->ss.ss_currentRelation = currentRelation;	indexstate->ss.ss_currentScanDesc = NULL;	/* no heap scan here */	/*	 * get the scan type from the relation descriptor.	 */	ExecAssignScanType(&indexstate->ss, RelationGetDescr(currentRelation));	/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&indexstate->ss.ps);	ExecAssignScanProjectionInfo(&indexstate->ss);	/*	 * If we are just doing EXPLAIN (ie, aren't going to run the plan), stop	 * here.  This allows an index-advisor plugin to EXPLAIN a plan containing	 * references to nonexistent indexes.	 */	if (eflags & EXEC_FLAG_EXPLAIN_ONLY)		return indexstate;	/*	 * Open the index relation.	 *	 * If the parent table is one of the target relations of the query, then	 * InitPlan already opened and write-locked the index, so we can avoid	 * taking another lock here.  Otherwise we need a normal reader's lock.	 */	relistarget = ExecRelationIsTargetRelation(estate, node->scan.scanrelid);	indexstate->iss_RelationDesc = index_open(node->indexid,									 relistarget ? NoLock : AccessShareLock);	/*	 * Initialize index-specific scan state//.........这里部分代码省略.........
开发者ID:aKhadiemik,项目名称:postgres,代码行数:101,


示例22: ExecInitMaterial

/* ---------------------------------------------------------------- *		ExecInitMaterial * ---------------------------------------------------------------- */MaterialState *ExecInitMaterial(Material *node, EState *estate, int eflags){	MaterialState *matstate;	Plan	   *outerPlan;	/*	 * create state structure	 */	matstate = makeNode(MaterialState);	matstate->ss.ps.plan = (Plan *) node;	matstate->ss.ps.state = estate;	/*	 * We must have random access to the subplan output to do backward scan or	 * mark/restore.  We also prefer to materialize the subplan output if we	 * might be called on to rewind and replay it many times. However, if none	 * of these cases apply, we can skip storing the data.	 */	matstate->randomAccess = node->cdb_strict ||							(eflags & (EXEC_FLAG_REWIND |										EXEC_FLAG_BACKWARD |										EXEC_FLAG_MARK)) != 0;	matstate->eof_underlying = false;	matstate->ts_state = palloc0(sizeof(GenericTupStore));	matstate->ts_pos = NULL;	matstate->ts_markpos = NULL;	matstate->share_lk_ctxt = NULL;	matstate->ts_destroyed = false;	ExecMaterialResetWorkfileState(matstate);	/*	 * Miscellaneous initialization	 *	 * Materialization nodes don't need ExprContexts because they never call	 * ExecQual or ExecProject.	 */#define MATERIAL_NSLOTS 2	/*	 * tuple table initialization	 *	 * material nodes only return tuples from their materialized relation.	 */	ExecInitResultTupleSlot(estate, &matstate->ss.ps);	matstate->ss.ss_ScanTupleSlot = ExecInitExtraTupleSlot(estate);	/*	 * If eflag contains EXEC_FLAG_REWIND or EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK,	 * then this node is not eager free safe.	 */	matstate->ss.ps.delayEagerFree =		((eflags & (EXEC_FLAG_REWIND | EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)) != 0);	/*	 * initialize child nodes	 *	 * We shield the child node from the need to support BACKWARD, or	 * MARK/RESTORE.	 */	eflags &= ~(EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK);	/*	 * If Materialize does not have any external parameters, then it	 * can shield the child node from being rescanned as well, hence	 * we can clear the EXEC_FLAG_REWIND as well. If there are parameters,	 * don't clear the REWIND flag, as the child will be rewound.	 */	if (node->plan.allParam == NULL || node->plan.extParam == NULL)	{		eflags &= ~EXEC_FLAG_REWIND;	}	outerPlan = outerPlan(node);	/*	 * A very basic check to see if the optimizer requires the material to do a projection.	 * Ideally, this check would recursively compare all the target list expressions. However,	 * such a check is tricky because of the varno mismatch (outer plan may have a varno that	 * index into range table, while the material may refer to the same relation as "outer" varno)	 * [JIRA: MPP-25365]	 */	insist_log(list_length(node->plan.targetlist) == list_length(outerPlan->targetlist),			"Material operator does not support projection");	outerPlanState(matstate) = ExecInitNode(outerPlan, estate, eflags);	/*	 * If the child node of a Material is a Motion, then this Material node is	 * not eager free safe.	 */	if (IsA(outerPlan((Plan *)node), Motion))	{		matstate->ss.ps.delayEagerFree = true;	}//.........这里部分代码省略.........
开发者ID:BALDELab,项目名称:incubator-hawq,代码行数:101,


示例23: ExecInitSetOp

/* ---------------------------------------------------------------- *		ExecInitSetOp * *		This initializes the setop node state structures and *		the node's subplan. * ---------------------------------------------------------------- */SetOpState *ExecInitSetOp(SetOp *node, EState *estate, int eflags){	SetOpState *setopstate;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * create state structure	 */	setopstate = makeNode(SetOpState);	setopstate->ps.plan = (Plan *) node;	setopstate->ps.state = estate;	setopstate->eqfunctions = NULL;	setopstate->hashfunctions = NULL;	setopstate->setop_done = false;	setopstate->numOutput = 0;	setopstate->pergroup = NULL;	setopstate->grp_firstTuple = NULL;	setopstate->hashtable = NULL;	setopstate->tableContext = NULL;	/*	 * Miscellaneous initialization	 *	 * SetOp nodes have no ExprContext initialization because they never call	 * ExecQual or ExecProject.  But they do need a per-tuple memory context	 * anyway for calling execTuplesMatch.	 */	setopstate->tempContext =		AllocSetContextCreate(CurrentMemoryContext,							  "SetOp",							  ALLOCSET_DEFAULT_MINSIZE,							  ALLOCSET_DEFAULT_INITSIZE,							  ALLOCSET_DEFAULT_MAXSIZE);	/*	 * If hashing, we also need a longer-lived context to store the hash	 * table.  The table can't just be kept in the per-query context because	 * we want to be able to throw it away in ExecReScanSetOp.	 */	if (node->strategy == SETOP_HASHED)		setopstate->tableContext =			AllocSetContextCreate(CurrentMemoryContext,								  "SetOp hash table",								  ALLOCSET_DEFAULT_MINSIZE,								  ALLOCSET_DEFAULT_INITSIZE,								  ALLOCSET_DEFAULT_MAXSIZE);	/*	 * Tuple table initialization	 */	ExecInitResultTupleSlot(estate, &setopstate->ps);	/*	 * initialize child nodes	 *	 * If we are hashing then the child plan does not need to handle REWIND	 * efficiently; see ExecReScanSetOp.	 */	if (node->strategy == SETOP_HASHED)		eflags &= ~EXEC_FLAG_REWIND;	outerPlanState(setopstate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * setop nodes do no projections, so initialize projection info for this	 * node appropriately	 */	ExecAssignResultTypeFromTL(&setopstate->ps);	setopstate->ps.ps_ProjInfo = NULL;	/*	 * Precompute fmgr lookup data for inner loop. We need both equality and	 * hashing functions to do it by hashing, but only equality if not	 * hashing.	 */	if (node->strategy == SETOP_HASHED)		execTuplesHashPrepare(node->numCols,							  node->dupOperators,							  &setopstate->eqfunctions,							  &setopstate->hashfunctions);	else		setopstate->eqfunctions =			execTuplesMatchPrepare(node->numCols,								   node->dupOperators);	if (node->strategy == SETOP_HASHED)	{		build_hash_table(setopstate);		setopstate->table_filled = false;	}//.........这里部分代码省略.........
开发者ID:BioBD,项目名称:Hypothetical_Indexes,代码行数:101,


示例24: ExecInitMaterial

/* ---------------------------------------------------------------- *		ExecInitMaterial * ---------------------------------------------------------------- */MaterialState *ExecInitMaterial(Material *node, EState *estate, int eflags){	MaterialState *matstate;	Plan	   *outerPlan;	/*	 * create state structure	 */	matstate = makeNode(MaterialState);	matstate->ss.ps.plan = (Plan *) node;	matstate->ss.ps.state = estate;	/*	 * We must have random access to the subplan output to do backward scan	 * or mark/restore.  We also prefer to materialize the subplan output	 * if we might be called on to rewind and replay it many times.	 * However, if none of these cases apply, we can skip storing the data.	 */	matstate->randomAccess = (eflags & (EXEC_FLAG_REWIND |										EXEC_FLAG_BACKWARD |										EXEC_FLAG_MARK)) != 0;	matstate->eof_underlying = false;	matstate->tuplestorestate = NULL;	/*	 * Miscellaneous initialization	 *	 * Materialization nodes don't need ExprContexts because they never call	 * ExecQual or ExecProject.	 */#define MATERIAL_NSLOTS 2	/*	 * tuple table initialization	 *	 * material nodes only return tuples from their materialized relation.	 */	ExecInitResultTupleSlot(estate, &matstate->ss.ps);	ExecInitScanTupleSlot(estate, &matstate->ss);	/*	 * initialize child nodes	 *	 * We shield the child node from the need to support REWIND, BACKWARD,	 * or MARK/RESTORE.	 */	eflags &= ~(EXEC_FLAG_REWIND | EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK);	outerPlan = outerPlan(node);	outerPlanState(matstate) = ExecInitNode(outerPlan, estate, eflags);	/*	 * initialize tuple type.  no need to initialize projection info because	 * this node doesn't do projections.	 */	ExecAssignResultTypeFromTL(&matstate->ss.ps);	ExecAssignScanTypeFromOuterPlan(&matstate->ss);	matstate->ss.ps.ps_ProjInfo = NULL;	return matstate;}
开发者ID:jaiminpan,项目名称:bizgres,代码行数:68,


示例25: ExecInitSubqueryScan

/* ---------------------------------------------------------------- *		ExecInitSubqueryScan * ---------------------------------------------------------------- */SubqueryScanState *ExecInitSubqueryScan(SubqueryScan *node, EState *estate){	SubqueryScanState *subquerystate;	RangeTblEntry *rte;	EState	   *sp_estate;	MemoryContext oldcontext;	/*	 * SubqueryScan should not have any "normal" children.	 */	Assert(outerPlan(node) == NULL);	Assert(innerPlan(node) == NULL);	/*	 * create state structure	 */	subquerystate = makeNode(SubqueryScanState);	subquerystate->ss.ps.plan = (Plan *) node;	subquerystate->ss.ps.state = estate;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &subquerystate->ss.ps);	/*	 * initialize child expressions	 */	subquerystate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) subquerystate);	subquerystate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) subquerystate);#define SUBQUERYSCAN_NSLOTS 2	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &subquerystate->ss.ps);	ExecInitScanTupleSlot(estate, &subquerystate->ss);	/*	 * initialize subquery	 *	 * This should agree with ExecInitSubPlan	 */	rte = rt_fetch(node->scan.scanrelid, estate->es_range_table);	Assert(rte->rtekind == RTE_SUBQUERY);	/*	 * Do access checking on the rangetable entries in the subquery.	 */	ExecCheckRTPerms(rte->subquery->rtable);	/*	 * The subquery needs its own EState because it has its own rangetable. It	 * shares our Param ID space, however.	XXX if rangetable access were done	 * differently, the subquery could share our EState, which would eliminate	 * some thrashing about in this module...	 */	sp_estate = CreateExecutorState();	subquerystate->sss_SubEState = sp_estate;	oldcontext = MemoryContextSwitchTo(sp_estate->es_query_cxt);	sp_estate->es_range_table = rte->subquery->rtable;	sp_estate->es_param_list_info = estate->es_param_list_info;	sp_estate->es_param_exec_vals = estate->es_param_exec_vals;	sp_estate->es_tupleTable =		ExecCreateTupleTable(ExecCountSlotsNode(node->subplan) + 10);	sp_estate->es_snapshot = estate->es_snapshot;	sp_estate->es_crosscheck_snapshot = estate->es_crosscheck_snapshot;	sp_estate->es_instrument = estate->es_instrument;	/*	 * Start up the subplan (this is a very cut-down form of InitPlan())	 */	subquerystate->subplan = ExecInitNode(node->subplan, sp_estate);	MemoryContextSwitchTo(oldcontext);	subquerystate->ss.ps.ps_TupFromTlist = false;	/*	 * Initialize scan tuple type (needed by ExecAssignScanProjectionInfo)	 */	ExecAssignScanType(&subquerystate->ss,					   ExecGetResultType(subquerystate->subplan),					   false);	/*//.........这里部分代码省略.........
开发者ID:CraigBryan,项目名称:PostgresqlFun,代码行数:101,


示例26: ExecInitCteScan

//.........这里部分代码省略.........	 * Note: if we are in an EPQ recheck plan tree, it's likely that no access	 * to the tuplestore is needed at all, making this even more annoying.	 * It's not worth improving that as long as all the read pointers would	 * have REWIND anyway, but if we ever improve this logic then that aspect	 * should be considered too.	 */	eflags |= EXEC_FLAG_REWIND;	/*	 * CteScan should not have any children.	 */	Assert(outerPlan(node) == NULL);	Assert(innerPlan(node) == NULL);	/*	 * create new CteScanState for node	 */	scanstate = makeNode(CteScanState);	scanstate->ss.ps.plan = (Plan *) node;	scanstate->ss.ps.state = estate;	scanstate->eflags = eflags;	scanstate->cte_table = NULL;	scanstate->eof_cte = false;	/*	 * Find the already-initialized plan for the CTE query.	 */	scanstate->cteplanstate = (PlanState *) list_nth(estate->es_subplanstates,													 node->ctePlanId - 1);	/*	 * The Param slot associated with the CTE query is used to hold a pointer	 * to the CteState of the first CteScan node that initializes for this	 * CTE.  This node will be the one that holds the shared state for all the	 * CTEs, particularly the shared tuplestore.	 */	prmdata = &(estate->es_param_exec_vals[node->cteParam]);	Assert(prmdata->execPlan == NULL);	Assert(!prmdata->isnull);	scanstate->leader = (CteScanState *) DatumGetPointer(prmdata->value);	if (scanstate->leader == NULL)	{		/* I am the leader */		prmdata->value = PointerGetDatum(scanstate);		scanstate->leader = scanstate;		scanstate->cte_table = tuplestore_begin_heap(true, false, work_mem);		tuplestore_set_eflags(scanstate->cte_table, scanstate->eflags);		scanstate->readptr = 0;	}	else	{		/* Not the leader */		Assert(IsA(scanstate->leader, CteScanState));		/* Create my own read pointer, and ensure it is at start */		scanstate->readptr =			tuplestore_alloc_read_pointer(scanstate->leader->cte_table,										  scanstate->eflags);		tuplestore_select_read_pointer(scanstate->leader->cte_table,									   scanstate->readptr);		tuplestore_rescan(scanstate->leader->cte_table);	}	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &scanstate->ss.ps);	/*	 * initialize child expressions	 */	scanstate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) scanstate);	scanstate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) scanstate);	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &scanstate->ss.ps);	ExecInitScanTupleSlot(estate, &scanstate->ss);	/*	 * The scan tuple type (ie, the rowtype we expect to find in the work	 * table) is the same as the result rowtype of the CTE query.	 */	ExecAssignScanType(&scanstate->ss,					   ExecGetResultType(scanstate->cteplanstate));	/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&scanstate->ss.ps);	ExecAssignScanProjectionInfo(&scanstate->ss);	return scanstate;}
开发者ID:adam8157,项目名称:gpdb,代码行数:101,


示例27: ExecInitSort

/* ---------------------------------------------------------------- *		ExecInitSort * *		Creates the run-time state information for the sort node *		produced by the planner and initializes its outer subtree. * ---------------------------------------------------------------- */SortState *ExecInitSort(Sort *node, EState *estate, int eflags){	SortState  *sortstate;	SO1_printf("ExecInitSort: %s/n",			   "initializing sort node");	/*	 * create state structure	 */	sortstate = makeNode(SortState);	sortstate->ss.ps.plan = (Plan *) node;	sortstate->ss.ps.state = estate;	/*	 * We must have random access to the sort output to do backward scan or	 * mark/restore.  We also prefer to materialize the sort output if we	 * might be called on to rewind and replay it many times.	 */	sortstate->randomAccess = (eflags & (EXEC_FLAG_REWIND |										 EXEC_FLAG_BACKWARD |										 EXEC_FLAG_MARK)) != 0;	sortstate->bounded = false;	sortstate->sort_Done = false;	sortstate->tuplesortstate = NULL;	/*	 * Miscellaneous initialization	 *	 * Sort nodes don't initialize their ExprContexts because they never call	 * ExecQual or ExecProject.	 */	/*	 * tuple table initialization	 *	 * sort nodes only return scan tuples from their sorted relation.	 */	ExecInitResultTupleSlot(estate, &sortstate->ss.ps);	ExecInitScanTupleSlot(estate, &sortstate->ss);	/*	 * initialize child nodes	 *	 * We shield the child node from the need to support REWIND, BACKWARD, or	 * MARK/RESTORE.	 */	eflags &= ~(EXEC_FLAG_REWIND | EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK);	outerPlanState(sortstate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * initialize tuple type.  no need to initialize projection info because	 * this node doesn't do projections.	 */	ExecAssignResultTypeFromTL(&sortstate->ss.ps);	ExecAssignScanTypeFromOuterPlan(&sortstate->ss);	sortstate->ss.ps.ps_ProjInfo = NULL;	SO1_printf("ExecInitSort: %s/n",			   "sort node initialized");	return sortstate;}
开发者ID:jfhyn,项目名称:pipelinedb,代码行数:73,


示例28: ExecInitForeignScan

/* ---------------------------------------------------------------- *		ExecInitForeignScan * ---------------------------------------------------------------- */ForeignScanState *ExecInitForeignScan(ForeignScan *node, EState *estate, int eflags){	ForeignScanState *scanstate;	Relation	currentRelation;	FdwRoutine *fdwroutine;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));	/*	 * create state structure	 */	scanstate = makeNode(ForeignScanState);	scanstate->ss.ps.plan = (Plan *) node;	scanstate->ss.ps.state = estate;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &scanstate->ss.ps);	scanstate->ss.ps.ps_TupFromTlist = false;	/*	 * initialize child expressions	 */	scanstate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) scanstate);	scanstate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) scanstate);	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &scanstate->ss.ps);	ExecInitScanTupleSlot(estate, &scanstate->ss);	/*	 * open the base relation and acquire appropriate lock on it.	 */	currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid);	scanstate->ss.ss_currentRelation = currentRelation;	/*	 * get the scan type from the relation descriptor.	 */	ExecAssignScanType(&scanstate->ss, RelationGetDescr(currentRelation));	/*	 * Initialize result tuple type and projection info.	 */	ExecAssignResultTypeFromTL(&scanstate->ss.ps);	ExecAssignScanProjectionInfo(&scanstate->ss);	/*	 * Acquire function pointers from the FDW's handler, and init fdw_state.	 */	fdwroutine = GetFdwRoutineByRelId(RelationGetRelid(currentRelation));	scanstate->fdwroutine = fdwroutine;	scanstate->fdw_state = NULL;	/*	 * Tell the FDW to initiate the scan.	 */	fdwroutine->BeginForeignScan(scanstate, eflags);	return scanstate;}
开发者ID:bwright,项目名称:postgres,代码行数:77,


示例29: ExecInitIndexOnlyScan

/* ---------------------------------------------------------------- *		ExecInitIndexOnlyScan * *		Initializes the index scan's state information, creates *		scan keys, and opens the base and index relations. * *		Note: index scans have 2 sets of state information because *			  we have to keep track of the base relation and the *			  index relation. * ---------------------------------------------------------------- */IndexOnlyScanState *ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags){	IndexOnlyScanState *indexstate;	Relation	currentRelation;	bool		relistarget;	TupleDesc	tupDesc;	/*	 * create state structure	 */	indexstate = makeNode(IndexOnlyScanState);	indexstate->ss.ps.plan = (Plan *) node;	indexstate->ss.ps.state = estate;	indexstate->ioss_HeapFetches = 0;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &indexstate->ss.ps);	indexstate->ss.ps.ps_TupFromTlist = false;	/*	 * initialize child expressions	 *	 * Note: we don't initialize all of the indexorderby expression, only the	 * sub-parts corresponding to runtime keys (see below).	 */	indexstate->ss.ps.targetlist = (List *)		ExecInitExpr((Expr *) node->scan.plan.targetlist,					 (PlanState *) indexstate);	indexstate->ss.ps.qual = (List *)		ExecInitExpr((Expr *) node->scan.plan.qual,					 (PlanState *) indexstate);	indexstate->indexqual = (List *)		ExecInitExpr((Expr *) node->indexqual,					 (PlanState *) indexstate);	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &indexstate->ss.ps);	ExecInitScanTupleSlot(estate, &indexstate->ss);	/*	 * open the base relation and acquire appropriate lock on it.	 */	currentRelation = ExecOpenScanRelation(estate, node->scan.scanrelid, eflags);	indexstate->ss.ss_currentRelation = currentRelation;	indexstate->ss.ss_currentScanDesc = NULL;	/* no heap scan here */	/*	 * Build the scan tuple type using the indextlist generated by the	 * planner.  We use this, rather than the index's physical tuple	 * descriptor, because the latter contains storage column types not the	 * types of the original datums.  (It's the AM's responsibility to return	 * suitable data anyway.)	 */	tupDesc = ExecTypeFromTL(node->indextlist, false);	ExecAssignScanType(&indexstate->ss, tupDesc);	/*	 * Initialize result tuple type and projection info.  The node's	 * targetlist will contain Vars with varno = INDEX_VAR, referencing the	 * scan tuple.	 */	ExecAssignResultTypeFromTL(&indexstate->ss.ps);	ExecAssignScanProjectionInfoWithVarno(&indexstate->ss, INDEX_VAR);	/*	 * If we are just doing EXPLAIN (ie, aren't going to run the plan), stop	 * here.  This allows an index-advisor plugin to EXPLAIN a plan containing	 * references to nonexistent indexes.	 */	if (eflags & EXEC_FLAG_EXPLAIN_ONLY)		return indexstate;	/*	 * Open the index relation.	 *	 * If the parent table is one of the target relations of the query, then	 * InitPlan already opened and write-locked the index, so we can avoid	 * taking another lock here.  Otherwise we need a normal reader's lock.	 */	relistarget = ExecRelationIsTargetRelation(estate, node->scan.scanrelid);//.........这里部分代码省略.........
开发者ID:EccentricLoggers,项目名称:peloton,代码行数:101,


示例30: ExecInitResult

/* ---------------------------------------------------------------- *		ExecInitResult * *		Creates the run-time state information for the result node *		produced by the planner and initializes outer relations *		(child nodes). * ---------------------------------------------------------------- */ResultState *ExecInitResult(Result *node, EState *estate, int eflags){	ResultState *resstate;	/* check for unsupported flags */	Assert(!(eflags & (EXEC_FLAG_MARK | EXEC_FLAG_BACKWARD)) ||		   outerPlan(node) != NULL);	/*	 * create state structure	 */	resstate = makeNode(ResultState);	resstate->ps.plan = (Plan *) node;	resstate->ps.state = estate;	resstate->rs_done = false;	resstate->rs_checkqual = (node->resconstantqual == NULL) ? false : true;	/*	 * Miscellaneous initialization	 *	 * create expression context for node	 */	ExecAssignExprContext(estate, &resstate->ps);	resstate->ps.ps_TupFromTlist = false;	/*	 * tuple table initialization	 */	ExecInitResultTupleSlot(estate, &resstate->ps);	/*	 * initialize child expressions	 */	resstate->ps.targetlist = (List *)		ExecInitExpr((Expr *) node->plan.targetlist,					 (PlanState *) resstate);	resstate->ps.qual = (List *)		ExecInitExpr((Expr *) node->plan.qual,					 (PlanState *) resstate);	resstate->resconstantqual = ExecInitExpr((Expr *) node->resconstantqual,											 (PlanState *) resstate);	/*	 * initialize child nodes	 */	outerPlanState(resstate) = ExecInitNode(outerPlan(node), estate, eflags);	/*	 * we don't use inner plan	 */	Assert(innerPlan(node) == NULL);	/*	 * initialize tuple type and projection info	 */	ExecAssignResultTypeFromTL(&resstate->ps);	ExecAssignProjectionInfo(&resstate->ps, NULL);	return resstate;}
开发者ID:EccentricLoggers,项目名称:peloton,代码行数:71,



注:本文中的ExecInitResultTupleSlot函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ExecInitScanTupleSlot函数代码示例
C++ ExecInitNode函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。