Does Cosmos DB have inverted index per physical partition or global inverted index

Balaji Sampath 0 Reputation points
2025-03-02T14:28:47.69+00:00

Will multiple inverted indexes be created for a container that has more than one physical partition?

Trying to understand how the query execution would be for a scenario where I cannot use the partition key but only relying on the index and there are multiple physical partitions. Will it perform two inverted index searches when there are two physical partitions?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,777 questions
0 comments No comments
{count} votes

Accepted answer
  1. Marcin Policht 37,215 Reputation points MVP
    2025-03-02T15:27:15.7166667+00:00

    Yep - that's my understanding.

    AFAIK, when a container in Azure Cosmos DB spans multiple physical partitions, multiple inverted indexes may be created. Each physical partition will maintain its own local index. This way, f a query involves an indexed field (like one using an inverted index), and the query cannot leverage the partition key, Cosmos DB will perform an index lookup on each partition to retrieve the results.

    If there are two physical partitions, Cosmos DB will perform two separate inverted index searches—one per partition—then merge the results.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.