MongoDB DBA · 题目 373 · 多选

which of the following scenarios below are when the hint() is recommended for use with a query in MongoDB? Check all that apply:

题目选项

  1. A.
    In cases where there are multiple indexes on the collection
  2. B.
    In scenarios where there are a handful of very different indexes
  3. C.
    In scenarios where you have not already looked at the index utilization for the query

答案置信度:中

正确答案:B

解析语言:中文

只有当集合上存在"少数几个差异很大的索引"、优化器可能挑错索引时,才建议用 hint() 强制指定,故选 B。A 过于宽泛——集合上有多个索引是常态,本身并不构成使用 hint 的理由;C 恰好说反了:应当先用 explain 看索引使用情况(index utilization)再决定是否 hint,否则容易把更差的计划固化下来。

所在套题

此题在题库中有 2 条记录。公开详情合并相同题干和选项;完整公开题展示置信度最高的一条记录,其他题目仅展示摘要。按套学习保留每条记录原有的答案、解析和置信度。

作者 · 作品 · 开源

作者与 MongoDB 作品

专注数据平台、MongoDB 迁移同步与云运维产品研发。

有任何 MongoDB 需求,均可联系作者。

联系作者 ↗mlhp123@outlook.com

支持作者

如果题库对您有帮助,欢迎自愿扫码打赏。

支付宝扫码打赏作者打开打赏原图 ↗