【问题标题】:Mongodb sorting performance with indexMongodb 带索引的排序性能
【发布时间】:2019-12-27 14:18:44
【问题描述】:

带/不带索引的 MongoDb 排序性能 我有 500k 测试文件:

_id:5d5e5eb7f6ac46d3b0d88243
startDate:2019-08-23 13:08:34.377       (Date type)
duration:315532
_class:"Inviter Record"

我有按 startDate (ASC) 的简单索引 通过查询{startDate: 1} 性能(使用说明)和索引对我的文档进行排序:

executionTimeMillis: 977

没有:

executionTimeMillis: 356

我期待相反的结果

【问题讨论】:

    标签: mongodb performance sorting indexing


    【解决方案1】:

    我搞砸了(使用没有索引的 500k 文档排序,我实际上得到了 300+- milisec,但我也得到了 executionStatus: false 错误,比如你不能在 RAM 中保存超过 32mb 的数据,请使用索引

    【讨论】:

      猜你喜欢
      • 2020-05-11
      • 1970-01-01
      • 1970-01-01
      • 2017-02-07
      • 2012-06-09
      • 1970-01-01
      • 2016-07-10
      • 2013-09-16
      • 1970-01-01
      相关资源
      最近更新 更多