9. Which of the following are true for MongoDB's compound indexes? Check all that apply:
题目选项
- A.The field order in the compound index is not important.
- B.Support queries that match on the postfix of the index fields.
- C.Support queries that match on the prefix of the index fields.
答案置信度:高
正确答案:C
解析语言:中文
复合索引遵循最左前缀原则,查询用到索引的前缀字段(如 {a} 或 {a,b})才能被索引支持,所以 A 正确。B 错:字段顺序决定索引能支持哪些查询模式,非常重要;C 错:跳过前导字段、只用后缀字段(例如只按第二个字段查)无法使用该索引,索引无法“从中间”开始扫描。