What keeps a Cosmos DB query cheap in request units?
Why A is the answer
Including the partition key in the query
A partition key routes the query to one partition, rather than fanning out across all of them.
In detail
- The partition key sends a query to the right partition.
- That keeps it cheap.
- Choose a partition key that your main queries use.
Use case
An illustrative scenario, not a real incident.
A query for one customer's orders includes the partition key, so it hits one partition and uses few request units.
See it in different ways
flowchart TD
A["Query"] --> B{"Includes the partition key?"}
B -->|Yes| C["Single partition, lower RU cost"]
B -->|No| D["Cross-partition, higher RU cost"]mindmap
root((Cosmos DB))
Query cost
Use the partition key
Write cost
Index only what you query
Vectors
Stored in the documents
Changes
Change feedflowchart TD
Q{"Does the query include the partition key?"}
Q -->|"Yes"| A0["Single partition, cheap"]
Q -->|"No"| A1["Cross-partition, costly"]Key point: Include the partition key.
Why the other options are wrong
- B. Adding more properties to each of the documents
- More properties add storage and index cost.
- C. Running the same query from several clients at once
- Repeating a query adds cost.
- D. Reading every document, then filtering in application code
- Reading everything is the most expensive way.

