{
size_t size;
+ /* don't need this if not instrumenting or no workers */
+ if (!node->ps.instrument || pcxt->nworkers == 0)
+ return;
+
size = mul_size(pcxt->nworkers, sizeof(HashInstrumentation));
size = add_size(size, offsetof(SharedHashInfo, hinstrument));
shm_toc_estimate_chunk(&pcxt->estimator, size);
{
size_t size;
+ /* don't need this if not instrumenting or no workers */
+ if (!node->ps.instrument || pcxt->nworkers == 0)
+ return;
+
size = offsetof(SharedHashInfo, hinstrument) +
pcxt->nworkers * sizeof(HashInstrumentation);
node->shared_info = (SharedHashInfo *) shm_toc_allocate(pcxt->toc, size);
{
SharedHashInfo *shared_info;
- /* might not be there ... */
+ /* don't need this if not instrumenting */
+ if (!node->ps.instrument)
+ return;
+
shared_info = (SharedHashInfo *)
- shm_toc_lookup(pwcxt->toc, node->ps.plan->plan_node_id, true);
- if (shared_info)
- node->hinstrument = &shared_info->hinstrument[ParallelWorkerNumber];
- else
- node->hinstrument = NULL;
+ shm_toc_lookup(pwcxt->toc, node->ps.plan->plan_node_id, false);
+ node->hinstrument = &shared_info->hinstrument[ParallelWorkerNumber];
}
/*
SharedHashInfo *shared_info = node->shared_info;
size_t size;
+ if (shared_info == NULL)
+ return;
+
/* Replace node->shared_info with a copy in backend-local memory. */
size = offsetof(SharedHashInfo, hinstrument) +
shared_info->num_workers * sizeof(HashInstrumentation);