* Locate the DSM space for hash table instrumentation data that we'll write * to at shutdown time. */
| 3328 | * to at shutdown time. |
| 3329 | */ |
| 3330 | void |
| 3331 | ExecHashInitializeWorker(HashState *node, ParallelWorkerContext *pwcxt) |
| 3332 | { |
| 3333 | SharedHashInfo *shared_info; |
| 3334 | HashJoinState *hjstate = node->hashtable->hjstate; |
| 3335 | /* don't need this if not instrumenting */ |
| 3336 | if (!node->ps.instrument || !hjstate) |
| 3337 | return; |
| 3338 | |
| 3339 | /* |
| 3340 | * Find our entry in the shared area, and set up a pointer to it so that |
| 3341 | * we'll accumulate stats there when shutting down or rebuilding the hash |
| 3342 | * table. |
| 3343 | */ |
| 3344 | shared_info = (SharedHashInfo *) |
| 3345 | shm_toc_lookup(pwcxt->toc, node->ps.plan->plan_node_id, false); |
| 3346 | Assert(hjstate->worker_id >= 1); |
| 3347 | node->hinstrument = &shared_info->hinstrument[hjstate->worker_id - 1]; |
| 3348 | } |
| 3349 | |
| 3350 | /* |
| 3351 | * Collect EXPLAIN stats if needed, saving them into DSM memory if |
no test coverage detected