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

Function CheckIndexHasReducedTerms

pg_documentdb/src/index_am/rum.c:1469–1486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467
1468
1469static bool
1470CheckIndexHasReducedTerms(Relation indexRelation, IndexAmRoutine *coreRoutine)
1471{
1472 /* Start a nested query lookup */
1473 IndexScanDesc innerDesc = coreRoutine->ambeginscan(indexRelation, 1, 0);
1474
1475 ScanKeyData arrayKey = { 0 };
1476 arrayKey.sk_attno = 1;
1477 arrayKey.sk_collation = InvalidOid;
1478 arrayKey.sk_strategy = BSON_INDEX_STRATEGY_HAS_CORRELATED_REDUCED_TERMS;
1479 arrayKey.sk_argument = PointerGetDatum(PgbsonInitEmpty());
1480
1481 innerDesc->parallel_scan = NULL;
1482 coreRoutine->amrescan(innerDesc, &arrayKey, 1, NULL, 0);
1483 bool hasReducedArrayTerms = coreRoutine->amgettuple(innerDesc, ForwardScanDirection);
1484 coreRoutine->amendscan(innerDesc);
1485 return hasReducedArrayTerms;
1486}
1487
1488
1489static IndexMultiKeyStatus

Callers 2

extension_rumrescan_coreFunction · 0.85

Calls 1

PgbsonInitEmptyFunction · 0.85

Tested by

no test coverage detected