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

Function ExecParallelGetQueryDesc

src/backend/executor/execParallel.c:1232–1258  ·  view source on GitHub ↗

* Create a QueryDesc for the PlannedStmt we are to execute, and return it. */

Source from the content-addressed store, hash-verified

1230 * Create a QueryDesc for the PlannedStmt we are to execute, and return it.
1231 */
1232static QueryDesc *
1233ExecParallelGetQueryDesc(shm_toc *toc, DestReceiver *receiver,
1234 int instrument_options)
1235{
1236 char *pstmtspace;
1237 char *paramspace;
1238 PlannedStmt *pstmt;
1239 ParamListInfo paramLI;
1240 char *queryString;
1241
1242 /* Get the query string from shared memory */
1243 queryString = shm_toc_lookup(toc, PARALLEL_KEY_QUERY_TEXT, false);
1244
1245 /* Reconstruct leader-supplied PlannedStmt. */
1246 pstmtspace = shm_toc_lookup(toc, PARALLEL_KEY_PLANNEDSTMT, false);
1247 pstmt = (PlannedStmt *) stringToNode(pstmtspace);
1248
1249 /* Reconstruct ParamListInfo. */
1250 paramspace = shm_toc_lookup(toc, PARALLEL_KEY_PARAMLISTINFO, false);
1251 paramLI = RestoreParamList(&paramspace);
1252
1253 /* Create a QueryDesc for the query. */
1254 return CreateQueryDesc(pstmt,
1255 queryString,
1256 GetActiveSnapshot(), InvalidSnapshot,
1257 receiver, paramLI, NULL, instrument_options);
1258}
1259
1260/*
1261 * Copy instrumentation information from this node and its descendants into

Callers 1

ParallelQueryMainFunction · 0.85

Calls 5

shm_toc_lookupFunction · 0.85
stringToNodeFunction · 0.85
RestoreParamListFunction · 0.85
CreateQueryDescFunction · 0.85
GetActiveSnapshotFunction · 0.85

Tested by

no test coverage detected