What's changed: Created DP-420 Chapter 4 (Domain 4: query optimization and indexing (indexing policy included/excluded paths, write-heavy vs read-heavy, composite index, range/spatial, integrated cache via dedicated gateway, RU cost via request charge/query metrics); change feed (Azure Functions trigger/SDK change feed processor with lease/change feed estimator backlog/denormalize update-referential enforcement-aggregation persistence-archiving)).
4.1Query optimization and indexing
Understand index tuning, calculating/retrieving query RU cost, the integrated cache, read-heavy vs write-heavy index strategy, composite indexes, and custom indexing policies.
Cosmos DB indexes all properties by default. Tuning the indexing policy to the workload is the core of optimizing query performance and RU cost.
4.1.1Index strategy and composite indexes
A custom indexing policy specifies included paths (to index) and excluded paths (to exclude). Write-heavy workloads exclude unneeded paths to lower index-update RU (fewer indexes = cheaper writes). Read-heavy workloads index the paths used to filter queries. A composite index optimizes ORDER BY on multiple properties and multi-filter queries (for queries a single index cannot serve). Use a spatial index for geospatial data and a range index for range/equality, by purpose.
4.1.2Understanding RU cost and the integrated cache
Continue reading — free sign-up
You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.

