Range Index

From Ilianko
Revision as of 15:07, 26 October 2026 by Anko (talk | contribs) (Recreated DP-420 term page: Range Index (Optimization))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

← Back to DP-420 Terminology Reference

Category: Optimization

Summary: Default index type for string/numeric properties; supports equality, range, and ORDER BY.

Overview

A range index is the default index type Azure Cosmos DB applies to string and numeric properties, storing values in a sorted (B-tree-like) structure that efficiently supports equality (=), range (>, <,>=, <=), ORDER BY, and JOIN queries on that property. Because the default indexing policy indexes every property with a range index automatically, most queries work efficiently out of the box without any manual index tuning.

//old way of authenticating
//new CosmosClient(endpoint, accountKey)
//new way of authenticating
-> new CosmosClient(endpoint, new DefaultAzureCredential());

More Info & Links

DP-420 Style Practice Questions

Q1. What is the default index type applied to string and numeric properties in Azure Cosmos DB?

  • A. Range index
  • B. Spatial index
  • C. Composite index
  • D. Hash index

Q2. Which query types does a range index efficiently support?

  • A. Equality, range comparisons, and ORDER BY on the indexed property
  • B. Only geospatial proximity searches
  • C. Only vector similarity searches
  • D. Only queries against the partition key

Answer Key

Answers are listed at the very end so you can attempt the questions first.

  • Q1 (Range Index): A. Range index — Range indexes are applied by default to string and numeric properties and support equality, range, and ORDER BY queries.
  • Q2 (Range Index): A. Equality, range comparisons, and ORDER BY on the indexed property — A range index supports equality, range (>, <,>=, <=), ORDER BY, and JOIN operations on the indexed property.

DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page