| 1381 | |
| 1382 | |
| 1383 | IndexBuildResult * |
| 1384 | extension_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 | |
| 1414 | static bool |
no test coverage detected