Documentdb Query Optimization

Query and aggregation-pipeline optimization rules for Azure DocumentDB — using `explain("executionStats")` to verify index usage and avoid `COLLSCAN`. Use when reviewing a specific query, diagnosing a slow query, or validating that an index is actually being used. For full index-design workflow, see the `documentdb-query-optimizer` skill.

Azure d505446 2 files · 1.9 KB Updated

File contents

Query & Aggregation Optimization — Azure DocumentDB

Best-practice rules for writing queries that can actually use indexes. For the full diagnostic workflow (explain output interpretation, ESR compound index design, covered queries, anti-patterns), see the documentdb-query-optimizer skill.

Rules

  • query-explain-plan — Use explain("executionStats") to verify index usage; watch keysExamined / docsExamined vs nReturned; avoid COLLSCAN.

azure/documentdb-agent-kit/tree/main/skills/query-optimization commit d505446903

Frequently asked questions

npx skillmds@latest add azure/documentdb-query-optimization