⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 execprocnode.c

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 C
📖 第 1 页 / 共 2 页
字号:
			result = ExecMergeJoin((MergeJoinState *) node);			break;		case T_HashJoinState:			result = ExecHashJoin((HashJoinState *) node);			break;			/*			 * materialization nodes			 */		case T_MaterialState:			result = ExecMaterial((MaterialState *) node);			break;		case T_SortState:			result = ExecSort((SortState *) node);			break;		case T_GroupState:			result = ExecGroup((GroupState *) node);			break;		case T_AggState:			result = ExecAgg((AggState *) node);			break;		case T_UniqueState:			result = ExecUnique((UniqueState *) node);			break;		case T_HashState:			result = ExecHash((HashState *) node);			break;		case T_SetOpState:			result = ExecSetOp((SetOpState *) node);			break;		case T_LimitState:			result = ExecLimit((LimitState *) node);			break;		default:			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));			result = NULL;			break;	}	if (node->instrument)		InstrStopNode(node->instrument, !TupIsNull(result));	return result;}/* ---------------------------------------------------------------- *		MultiExecProcNode * *		Execute a node that doesn't return individual tuples *		(it might return a hashtable, bitmap, etc).  Caller should *		check it got back the expected kind of Node. * * This has essentially the same responsibilities as ExecProcNode, * but it does not do InstrStartNode/InstrStopNode (mainly because * it can't tell how many returned tuples to count).  Each per-node * function must provide its own instrumentation support. * ---------------------------------------------------------------- */Node *MultiExecProcNode(PlanState *node){	Node	   *result;	CHECK_FOR_INTERRUPTS();	if (node->chgParam != NULL) /* something changed */		ExecReScan(node, NULL); /* let ReScan handle this */	switch (nodeTag(node))	{			/*			 * Only node types that actually support multiexec will be listed			 */		case T_HashState:			result = MultiExecHash((HashState *) node);			break;		case T_BitmapIndexScanState:			result = MultiExecBitmapIndexScan((BitmapIndexScanState *) node);			break;		case T_BitmapAndState:			result = MultiExecBitmapAnd((BitmapAndState *) node);			break;		case T_BitmapOrState:			result = MultiExecBitmapOr((BitmapOrState *) node);			break;		default:			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));			result = NULL;			break;	}	return result;}/* * ExecCountSlotsNode - count up the number of tuple table slots needed * * Note that this scans a Plan tree, not a PlanState tree, because we * haven't built the PlanState tree yet ... */intExecCountSlotsNode(Plan *node){	if (node == NULL)		return 0;	switch (nodeTag(node))	{			/*			 * control nodes			 */		case T_Result:			return ExecCountSlotsResult((Result *) node);		case T_Append:			return ExecCountSlotsAppend((Append *) node);		case T_BitmapAnd:			return ExecCountSlotsBitmapAnd((BitmapAnd *) node);		case T_BitmapOr:			return ExecCountSlotsBitmapOr((BitmapOr *) node);			/*			 * scan nodes			 */		case T_SeqScan:			return ExecCountSlotsSeqScan((SeqScan *) node);		case T_IndexScan:			return ExecCountSlotsIndexScan((IndexScan *) node);		case T_BitmapIndexScan:			return ExecCountSlotsBitmapIndexScan((BitmapIndexScan *) node);		case T_BitmapHeapScan:			return ExecCountSlotsBitmapHeapScan((BitmapHeapScan *) node);		case T_TidScan:			return ExecCountSlotsTidScan((TidScan *) node);		case T_SubqueryScan:			return ExecCountSlotsSubqueryScan((SubqueryScan *) node);		case T_FunctionScan:			return ExecCountSlotsFunctionScan((FunctionScan *) node);			/*			 * join nodes			 */		case T_NestLoop:			return ExecCountSlotsNestLoop((NestLoop *) node);		case T_MergeJoin:			return ExecCountSlotsMergeJoin((MergeJoin *) node);		case T_HashJoin:			return ExecCountSlotsHashJoin((HashJoin *) node);			/*			 * materialization nodes			 */		case T_Material:			return ExecCountSlotsMaterial((Material *) node);		case T_Sort:			return ExecCountSlotsSort((Sort *) node);		case T_Group:			return ExecCountSlotsGroup((Group *) node);		case T_Agg:			return ExecCountSlotsAgg((Agg *) node);		case T_Unique:			return ExecCountSlotsUnique((Unique *) node);		case T_Hash:			return ExecCountSlotsHash((Hash *) node);		case T_SetOp:			return ExecCountSlotsSetOp((SetOp *) node);		case T_Limit:			return ExecCountSlotsLimit((Limit *) node);		default:			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));			break;	}	return 0;}/* ---------------------------------------------------------------- *		ExecEndNode * *		Recursively cleans up all the nodes in the plan rooted *		at 'node'. * *		After this operation, the query plan will not be able to *		processed any further.	This should be called only after *		the query plan has been fully executed. * ---------------------------------------------------------------- */voidExecEndNode(PlanState *node){	ListCell   *subp;	/*	 * do nothing when we get to the end of a leaf on tree.	 */	if (node == NULL)		return;	/* Clean up initPlans and subPlans */	foreach(subp, node->initPlan)		ExecEndSubPlan((SubPlanState *) lfirst(subp));	foreach(subp, node->subPlan)		ExecEndSubPlan((SubPlanState *) lfirst(subp));	if (node->chgParam != NULL)	{		bms_free(node->chgParam);		node->chgParam = NULL;	}	switch (nodeTag(node))	{			/*			 * control nodes			 */		case T_ResultState:			ExecEndResult((ResultState *) node);			break;		case T_AppendState:			ExecEndAppend((AppendState *) node);			break;		case T_BitmapAndState:			ExecEndBitmapAnd((BitmapAndState *) node);			break;		case T_BitmapOrState:			ExecEndBitmapOr((BitmapOrState *) node);			break;			/*			 * scan nodes			 */		case T_SeqScanState:			ExecEndSeqScan((SeqScanState *) node);			break;		case T_IndexScanState:			ExecEndIndexScan((IndexScanState *) node);			break;		case T_BitmapIndexScanState:			ExecEndBitmapIndexScan((BitmapIndexScanState *) node);			break;		case T_BitmapHeapScanState:			ExecEndBitmapHeapScan((BitmapHeapScanState *) node);			break;		case T_TidScanState:			ExecEndTidScan((TidScanState *) node);			break;		case T_SubqueryScanState:			ExecEndSubqueryScan((SubqueryScanState *) node);			break;		case T_FunctionScanState:			ExecEndFunctionScan((FunctionScanState *) node);			break;			/*			 * join nodes			 */		case T_NestLoopState:			ExecEndNestLoop((NestLoopState *) node);			break;		case T_MergeJoinState:			ExecEndMergeJoin((MergeJoinState *) node);			break;		case T_HashJoinState:			ExecEndHashJoin((HashJoinState *) node);			break;			/*			 * materialization nodes			 */		case T_MaterialState:			ExecEndMaterial((MaterialState *) node);			break;		case T_SortState:			ExecEndSort((SortState *) node);			break;		case T_GroupState:			ExecEndGroup((GroupState *) node);			break;		case T_AggState:			ExecEndAgg((AggState *) node);			break;		case T_UniqueState:			ExecEndUnique((UniqueState *) node);			break;		case T_HashState:			ExecEndHash((HashState *) node);			break;		case T_SetOpState:			ExecEndSetOp((SetOpState *) node);			break;		case T_LimitState:			ExecEndLimit((LimitState *) node);			break;		default:			elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));			break;	}}

⌨️ 快捷键说明

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