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

Function ExecIndexScanInitializeDSM

src/backend/executor/nodeIndexscan.c:1692–1720  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecIndexScanInitializeDSM * * Set up a parallel index scan descriptor. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

1690 * ----------------------------------------------------------------
1691 */
1692void
1693ExecIndexScanInitializeDSM(IndexScanState *node,
1694 ParallelContext *pcxt)
1695{
1696 EState *estate = node->ss.ps.state;
1697 ParallelIndexScanDesc piscan;
1698
1699 piscan = shm_toc_allocate(pcxt->toc, node->iss_PscanLen);
1700 index_parallelscan_initialize(node->ss.ss_currentRelation,
1701 node->iss_RelationDesc,
1702 estate->es_snapshot,
1703 piscan);
1704 shm_toc_insert(pcxt->toc, node->ss.ps.plan->plan_node_id, piscan);
1705 node->iss_ScanDesc =
1706 index_beginscan_parallel(node->ss.ss_currentRelation,
1707 node->iss_RelationDesc,
1708 node->iss_NumScanKeys,
1709 node->iss_NumOrderByKeys,
1710 piscan);
1711
1712 /*
1713 * If no run-time keys to calculate or they are ready, go ahead and pass
1714 * the scankeys to the index AM.
1715 */
1716 if (node->iss_NumRuntimeKeys == 0 || node->iss_RuntimeKeysReady)
1717 index_rescan(node->iss_ScanDesc,
1718 node->iss_ScanKeys, node->iss_NumScanKeys,
1719 node->iss_OrderByKeys, node->iss_NumOrderByKeys);
1720}
1721
1722/* ----------------------------------------------------------------
1723 * ExecIndexScanReInitializeDSM

Callers 2

Calls 5

shm_toc_allocateFunction · 0.85
shm_toc_insertFunction · 0.85
index_beginscan_parallelFunction · 0.85
index_rescanFunction · 0.85

Tested by

no test coverage detected