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

Function ExecAggInitializeDSM

src/backend/executor/nodeAgg.c:5087–5104  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecAggInitializeDSM * * Initialize DSM space for aggregate statistics. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

5085 * ----------------------------------------------------------------
5086 */
5087void
5088ExecAggInitializeDSM(AggState *node, ParallelContext *pcxt)
5089{
5090 Size size;
5091
5092 /* don't need this if not instrumenting or no workers */
5093 if (!node->ss.ps.instrument || pcxt->nworkers == 0)
5094 return;
5095
5096 size = offsetof(SharedAggInfo, sinstrument)
5097 + pcxt->nworkers * sizeof(AggregateInstrumentation);
5098 node->shared_info = shm_toc_allocate(pcxt->toc, size);
5099 /* ensure any unfilled slots will contain zeroes */
5100 memset(node->shared_info, 0, size);
5101 node->shared_info->num_workers = pcxt->nworkers;
5102 shm_toc_insert(pcxt->toc, node->ss.ps.plan->plan_node_id,
5103 node->shared_info);
5104}
5105
5106/* ----------------------------------------------------------------
5107 * ExecAggInitializeWorker

Callers 1

Calls 2

shm_toc_allocateFunction · 0.85
shm_toc_insertFunction · 0.85

Tested by

no test coverage detected