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

Function RumGetTruncationStatus

pg_documentdb/src/index_am/rum.c:1509–1533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1507
1508
1509bool
1510RumGetTruncationStatus(Relation indexRelation)
1511{
1512 EnsureRumLibLoaded();
1513
1514 if (!IsCompositeOpClass(indexRelation))
1515 {
1516 return false;
1517 }
1518
1519 /* Start a nested query lookup */
1520 IndexScanDesc innerDesc = rum_index_routine.ambeginscan(indexRelation, 1, 0);
1521
1522 ScanKeyData truncatedKey = { 0 };
1523 truncatedKey.sk_attno = 1;
1524 truncatedKey.sk_collation = InvalidOid;
1525 truncatedKey.sk_strategy = BSON_INDEX_STRATEGY_HAS_TRUNCATED_TERMS;
1526 truncatedKey.sk_argument = PointerGetDatum(PgbsonInitEmpty());
1527 innerDesc->parallel_scan = NULL;
1528
1529 rum_index_routine.amrescan(innerDesc, &truncatedKey, 1, NULL, 0);
1530 bool hasTruncation = rum_index_routine.amgettuple(innerDesc, ForwardScanDirection);
1531 rum_index_routine.amendscan(innerDesc);
1532 return hasTruncation;
1533}
1534
1535
1536static List *

Callers 2

ExplainCompositeScanCoreFunction · 0.85

Calls 3

EnsureRumLibLoadedFunction · 0.85
IsCompositeOpClassFunction · 0.85
PgbsonInitEmptyFunction · 0.85

Tested by

no test coverage detected