---------------------------------------------------------------- * ExecAggInitializeDSM * * Initialize DSM space for aggregate statistics. * ---------------------------------------------------------------- */
| 5085 | * ---------------------------------------------------------------- |
| 5086 | */ |
| 5087 | void |
| 5088 | ExecAggInitializeDSM(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 |
no test coverage detected