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

Function IndexKeyGetReadyMatchingIndexes

pg_documentdb/src/metadata/index.c:1087–1099  ·  view source on GitHub ↗

* Given a collection and index key, returns the index details for the index * if it is ready to be used. If the index is not ready, returns NULL. */

Source from the content-addressed store, hash-verified

1085 * if it is ready to be used. If the index is not ready, returns NULL.
1086 */
1087List *
1088IndexKeyGetReadyMatchingIndexes(uint64 collectionId, const pgbson *indexKeyDocument)
1089{
1090 const char *cmdStr =
1091 FormatSqlQuery(
1092 "SELECT array_agg(index_id ORDER BY index_id), array_agg(index_spec ORDER BY index_id), "
1093 " array_agg(NOT(index_is_valid) ORDER BY index_id) "
1094 "FROM %s.collection_indexes WHERE collection_id = $1 AND"
1095 " (index_spec).index_key::%s OPERATOR(%s.=) $2::%s AND index_is_valid",
1096 ApiCatalogSchemaName, FullBsonTypeName, CoreSchemaName,
1097 FullBsonTypeName);
1098 return IndexKeyGetMatchingIndexesCore(cmdStr, collectionId, indexKeyDocument);
1099}
1100
1101
1102/*

Callers 1

GenerateBaseTableQueryFunction · 0.85

Calls 2

FormatSqlQueryFunction · 0.85

Tested by

no test coverage detected