AI-200 practice question 1 of 10

You are developing an AI application that processes customer embeddings stored in Azure Cosmos DB for NoSQL. Your application performs vector…

Full set: 67 questions
You are developing an AI application that processes customer embeddings stored in Azure Cosmos DB for NoSQL. Your application performs vector similarity searches frequently, but query latency is increasing as your dataset grows. You notice that Request Unit (RU) consumption is also higher than expected. Which combination of optimizations would most effectively reduce both query latency and RU consumption?
Answer options
A: Increase the provisioned throughput and implement a composite index that includes the embedding vector field and common filter attributes
B: Implement a composite indexing policy that covers filter attributes and query predicates, and set the consistency level to eventual consistency for read operations Correct answer
C: Remove all indexes except the vector index to reduce write latency, and increase the provisioned throughput by 50%
D: Implement full-text indexing on all fields and switch to strong consistency to ensure accuracy of vector similarity results
Correct Answer:
B. Implement a composite indexing policy that covers filter attributes and query predicates, and set the consistency level to eventual consistency for read operations
Explanation

To reduce both query latency and Request Unit (RU) consumption in Azure Cosmos DB, lowering the consistency level to eventual consistency is highly effective, as it consumes half the RUs for read operations compared to strong consistency and offers the lowest read latency. Additionally, implementing a composite indexing policy for frequently used filter attributes and query predicates ensures the database engine can efficiently evaluate filters before or during the vector search, significantly reducing the search space and the RUs required to process the query.

Why Incorrect

A: Increasing provisioned throughput accommodates higher RU usage but does not reduce actual RU consumption. C: Removing indexes on filter attributes would force cross-partition or full scans, drastically increasing RU consumption and latency. D: Strong consistency doubles the RU cost for reads and increases latency; full-text indexing does not optimize vector similarity searches.

References

1. Microsoft Learn: "Consistency levels in Azure Cosmos DB" - Section: Consistency levels and throughput.

2. Microsoft Learn: "Vector search in Azure Cosmos DB for NoSQL" - Section: Indexing policies and vector search optimization.

Scroll to Top