MCPcopy Create free account
hub / github.com/documentdb/documentdb / extension_rumbuild_core

Function extension_rumbuild_core

pg_documentdb/src/index_am/rum.c:1383–1411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1381
1382
1383IndexBuildResult *
1384extension_rumbuild_core(Relation heapRelation, Relation indexRelation,
1385 struct IndexInfo *indexInfo, IndexAmRoutine *coreRoutine,
1386 UpdateMultikeyStatusFunc updateMultikeyStatus,
1387 bool amCanBuildParallel)
1388{
1389 RumHasMultiKeyPaths = false;
1390 IndexBuildResult *result = coreRoutine->ambuild(heapRelation, indexRelation,
1391 indexInfo);
1392
1393 /* Update statistics to track that we're a multi-key index:
1394 * Note: We don't use HasMultiKeyPaths here as we want to handle the parallel build
1395 * scenario where we may have multiple workers building the index.
1396 */
1397 if (amCanBuildParallel && IsCompositeOpClass(indexRelation))
1398 {
1399 IndexMultiKeyStatus status = CheckIndexHasArrays(indexRelation, coreRoutine);
1400 if (status == IndexMultiKeyStatus_HasArrays && updateMultikeyStatus != NULL)
1401 {
1402 updateMultikeyStatus(indexRelation);
1403 }
1404 }
1405 else if (RumHasMultiKeyPaths && updateMultikeyStatus != NULL)
1406 {
1407 updateMultikeyStatus(indexRelation);
1408 }
1409
1410 return result;
1411}
1412
1413
1414static bool

Callers 2

extension_rumbuildFunction · 0.85

Calls 2

IsCompositeOpClassFunction · 0.85
CheckIndexHasArraysFunction · 0.85

Tested by

no test coverage detected