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

Function CheckIndexHasArrays

pg_documentdb/src/index_am/rum.c:1489–1506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1487
1488
1489static IndexMultiKeyStatus
1490CheckIndexHasArrays(Relation indexRelation, IndexAmRoutine *coreRoutine)
1491{
1492 /* Start a nested query lookup */
1493 IndexScanDesc innerDesc = coreRoutine->ambeginscan(indexRelation, 1, 0);
1494
1495 ScanKeyData arrayKey = { 0 };
1496 arrayKey.sk_attno = 1;
1497 arrayKey.sk_collation = InvalidOid;
1498 arrayKey.sk_strategy = BSON_INDEX_STRATEGY_IS_MULTIKEY;
1499 arrayKey.sk_argument = PointerGetDatum(PgbsonInitEmpty());
1500
1501 innerDesc->parallel_scan = NULL;
1502 coreRoutine->amrescan(innerDesc, &arrayKey, 1, NULL, 0);
1503 bool hasArrays = coreRoutine->amgettuple(innerDesc, ForwardScanDirection);
1504 coreRoutine->amendscan(innerDesc);
1505 return hasArrays ? IndexMultiKeyStatus_HasArrays : IndexMultiKeyStatus_HasNoArrays;
1506}
1507
1508
1509bool

Callers 3

extension_rumrescan_coreFunction · 0.85
extension_rumbuild_coreFunction · 0.85
RumGetMultiKeyStatusSlowFunction · 0.85

Calls 1

PgbsonInitEmptyFunction · 0.85

Tested by

no test coverage detected