MongoDB DBA · 题目 478 · 单选

54. Given the following query: find({"genre": "action"}).sort({"year": 1}).skip(100).limit(20) Which of the following steps would be executed by the mongos process, not by the mongod processes on each shard? Choose the best answer:

题目选项

  1. A.
    Walking an index to fetch the documents
  2. B.
    Applying a limit of 120 documents
  3. C.
    Sorting the result set in memory, without an index
  4. D.
    Looking for documents that have a field genre with value action
  5. E.
    Performing a skip operation of 100 documents

答案置信度:中

正确答案:C

解析语言:中文

查询被下发到相关分片后,过滤(A)与走索引取文档(E)由各分片完成,limit 结果上限(D 中的 120 = 100+20)也会下推到分片;而把各分片返回的有序结果在内存里做归并排序、且没有可用的单一索引,只能由 mongos 承担,因此选 C。

所在套题

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

作者 · 作品 · 开源

作者与 MongoDB 作品

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

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

联系作者 ↗mlhp123@outlook.com

支持作者

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

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