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

Function getGpExecIdentity

src/backend/executor/execUtils.c:1959–1991  ·  view source on GitHub ↗

* Choose the execution identity (who does this executor serve?). * There are types: * * 1. No-Op (ignore) -- this occurs when the specified direction is * NoMovementScanDirection or when Gp_role is GP_ROLE_DISPATCH * and the current slice belongs to a QE. * * 2. Executor serves a Root Slice -- this occurs when Gp_role is * GP_ROLE_UTILITY or the current slice is a root. It corresponds

Source from the content-addressed store, hash-verified

1957 * motion nodes (as in case 2).
1958 */
1959GpExecIdentity
1960getGpExecIdentity(QueryDesc *queryDesc,
1961 ScanDirection direction,
1962 EState *estate)
1963{
1964 ExecSlice *currentSlice;
1965
1966 currentSlice = getCurrentSlice(estate, LocallyExecutingSliceIndex(estate));
1967 if (currentSlice)
1968 {
1969 if (Gp_role == GP_ROLE_EXECUTE ||
1970 sliceRunsOnQD(currentSlice))
1971 currentSliceId = currentSlice->sliceIndex;
1972 }
1973
1974 /* select the strategy */
1975 if (direction == NoMovementScanDirection)
1976 {
1977 return GP_IGNORE;
1978 }
1979 else if (Gp_role == GP_ROLE_DISPATCH && sliceRunsOnQE(currentSlice))
1980 {
1981 return GP_IGNORE;
1982 }
1983 else if (Gp_role == GP_ROLE_EXECUTE && LocallyExecutingSliceIndex(estate) != RootSliceIndex(estate))
1984 {
1985 return GP_NON_ROOT_ON_QE;
1986 }
1987 else
1988 {
1989 return GP_ROOT_SLICE;
1990 }
1991}
1992
1993/*
1994 * End the gp-specific part of the executor.

Callers 3

standard_ExecutorStartFunction · 0.85
standard_ExecutorRunFunction · 0.85
standard_ExecutorFinishFunction · 0.85

Calls 5

getCurrentSliceFunction · 0.85
sliceRunsOnQDFunction · 0.85
sliceRunsOnQEFunction · 0.85
RootSliceIndexFunction · 0.85

Tested by

no test coverage detected