MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecProcNodeGPDB

Function ExecProcNodeGPDB

src/backend/executor/execProcnode.c:630–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630static TupleTableSlot *
631ExecProcNodeGPDB(PlanState *node)
632{
633 TupleTableSlot *result;
634 MemoryContext oldcxt = NULL;
635
636 /*
637 * Even if we are requested to finish query, Motion has to do its work
638 * to tell End of Stream message to upper slice. He will probably get
639 * NULL tuple from underlying operator by calling another ExecProcNode,
640 * so one additional operator execution should not be a big hit.
641 */
642 if (QueryFinishPending && !IsA(node, MotionState))
643 return NULL;
644
645 if (node->plan)
646 TRACE_POSTGRESQL_EXECPROCNODE_ENTER(GpIdentity.segindex, currentSliceId, nodeTag(node), node->plan->plan_node_id);
647
648 if (node->squelched)
649 elog(ERROR, "cannot execute squelched plan node of type: %d",
650 (int) nodeTag(node));
651
652 if (!node->fHadSentNodeStart)
653 {
654 /* GPDB hook for collecting query info */
655 if (query_info_collect_hook)
656 (*query_info_collect_hook)(METRICS_PLAN_NODE_EXECUTING, node);
657 node->fHadSentNodeStart = true;
658 }
659
660 if (node->instrument)
661 InstrStartNode(node->instrument);
662
663 if ((node->state->es_instrument & INSTRUMENT_MEMORY_DETAIL) != 0)
664 oldcxt = MemoryContextSwitchTo(node->node_context);
665
666 result = node->ExecProcNodeReal(node);
667
668 if ((node->state->es_instrument & INSTRUMENT_MEMORY_DETAIL) != 0)
669 {
670 Assert(CurrentMemoryContext == node->node_context);
671 MemoryContextSwitchTo(oldcxt);
672 }
673
674 if (node->instrument)
675 InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
676
677 if (node->plan)
678 TRACE_POSTGRESQL_EXECPROCNODE_EXIT(GpIdentity.segindex, currentSliceId, nodeTag(node), node->plan->plan_node_id);
679
680 return result;
681}
682
683/*
684 * ExecProcNode wrapper that performs instrumentation calls. By keeping

Callers

nothing calls this directly

Calls 3

InstrStartNodeFunction · 0.85
MemoryContextSwitchToFunction · 0.85
InstrStopNodeFunction · 0.85

Tested by

no test coverage detected