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

Function standard_ExecutorRun

src/backend/executor/execMain.c:848–1127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846}
847
848void
849standard_ExecutorRun(QueryDesc *queryDesc,
850 ScanDirection direction, uint64 count, bool execute_once)
851{
852 EState *estate;
853 CmdType operation;
854 DestReceiver *dest;
855 bool sendTuples;
856 MemoryContext oldcontext;
857 bool endpointCreated = false;
858 uint64 es_processed = 0;
859 /*
860 * NOTE: Any local vars that are set in the PG_TRY block and examined in the
861 * PG_CATCH block should be declared 'volatile'. (setjmp shenanigans)
862 */
863 ExecSlice *currentSlice;
864 GpExecIdentity exec_identity;
865 bool amIParallel = false;
866
867 /* sanity checks */
868 Assert(queryDesc != NULL);
869
870 estate = queryDesc->estate;
871
872 Assert(estate != NULL);
873 Assert(!(estate->es_top_eflags & EXEC_FLAG_EXPLAIN_ONLY));
874
875 /*
876 * Switch into per-query memory context
877 */
878 oldcontext = MemoryContextSwitchTo(estate->es_query_cxt);
879
880 /* Allow instrumentation of Executor overall runtime */
881 if (queryDesc->totaltime)
882 InstrStartNode(queryDesc->totaltime);
883
884 /*
885 * CDB: Update global slice id for log messages.
886 */
887 currentSlice = getCurrentSlice(estate, LocallyExecutingSliceIndex(estate));
888 if (currentSlice)
889 {
890 if (Gp_role == GP_ROLE_EXECUTE ||
891 sliceRunsOnQD(currentSlice))
892 {
893 currentSliceId = currentSlice->sliceIndex;
894 amIParallel = currentSlice->useMppParallelMode;
895 }
896 }
897
898 /*
899 * extract information from the query descriptor and the query feature.
900 */
901 operation = queryDesc->operation;
902 dest = queryDesc->dest;
903
904 /*
905 * startup tuple receiver, if we will be emitting tuples

Callers 3

pgss_ExecutorRunFunction · 0.85
explain_ExecutorRunFunction · 0.85
ExecutorRunFunction · 0.85

Calls 15

MemoryContextSwitchToFunction · 0.85
InstrStartNodeFunction · 0.85
getCurrentSliceFunction · 0.85
sliceRunsOnQDFunction · 0.85
getGpExecIdentityFunction · 0.85
getMotionStateFunction · 0.85
ExecutePlanFunction · 0.85
SetupEndpointExecStateFunction · 0.85
EndpointNotifyQDFunction · 0.85
mppExecutorWaitFunction · 0.85

Tested by

no test coverage detected