MongoDB DBA · Question 492 · Multiple choice

9. Which of the following are true for MongoDB's compound indexes? Check all that apply:

Answer options

  1. A.
    The field order in the compound index is not important.
  2. B.
    Support queries that match on the postfix of the index fields.
  3. C.
    Support queries that match on the prefix of the index fields.

Answer confidence: High

Correct answer: C

Explanation language: Chinese

复合索引遵循最左前缀原则,查询用到索引的前缀字段(如 {a} 或 {a,b})才能被索引支持,所以 A 正确。B 错:字段顺序决定索引能支持哪些查询模式,非常重要;C 错:跳过前导字段、只用后缀字段(例如只按第二个字段查)无法使用该索引,索引无法“从中间”开始扫描。

Papers containing this question

This question appears in 1 bank records. Public pages combine identical prompts and options. Selected questions display the highest-confidence record; the others show a short preview. Paper-based learning preserves each record's answer, explanation, and confidence.

AUTHOR · PROJECTS · OPEN SOURCE

Author & MongoDB projects

Building data platforms, MongoDB migration and sync tools, and cloud operations products.

Contact the author for any MongoDB needs.

Contact the author ↗mlhp123@outlook.com

Support the author

If this question bank helps you, optional donations are welcome.

Scan with Alipay to support the authorOpen full-size donation image ↗