documentdb-query-optimization

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Query & Aggregation Optimization — Azure DocumentDB

查询与聚合优化 —— 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.
编写可实际利用索引的查询的最佳实践规则。如需完整的诊断工作流(解释输出解读、ESR复合索引设计、覆盖查询、反模式),请查看
documentdb-query-optimizer
技能。

Rules

规则

  • query-explain-plan — Use
    explain("executionStats")
    to verify index usage; watch
    keysExamined
    /
    docsExamined
    vs
    nReturned
    ; avoid
    COLLSCAN
    .
  • query-explain-plan —— 使用
    explain("executionStats")
    验证索引使用情况;关注
    keysExamined
    /
    docsExamined
    nReturned
    的对比;避免
    COLLSCAN