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

Function ExecHashInitializeWorker

src/backend/executor/nodeHash.c:3330–3348  ·  view source on GitHub ↗

* Locate the DSM space for hash table instrumentation data that we'll write * to at shutdown time. */

Source from the content-addressed store, hash-verified

3328 * to at shutdown time.
3329 */
3330void
3331ExecHashInitializeWorker(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

Callers 1

Calls 1

shm_toc_lookupFunction · 0.85

Tested by

no test coverage detected