QuestionQ80

Optimize an Azure Cosmos DB solution

You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account named account1. The account hosts a container named Devices, which has a partition key named type.

You plan to run the following query:

SELECT d.deviceName  
FROM d  
WHERE d.deviceId = 'ABC102'  
  AND d.type = 'car'  
  AND d.importanceId = 4  

You are assessing the query's resource utilization.

How will the query execute?

  • A as an in-partition query
  • B as a parallel cross-partition query
  • C as a cross-partition query
Explanation

An equality predicate on the container's partition key, type = 'car', lets Azure Cosmos DB route the query to the single logical partition for car. The additional predicates do not require querying other partitions, so this is an in-partition query. Query an Azure Cosmos DB container

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!