mongodb - Mongodb 带索引的排序性能
问题描述
带/不带索引的 MongoDb 排序性能我有 500k 测试文件:
_id:5d5e5eb7f6ac46d3b0d88243
startDate:2019-08-23 13:08:34.377 (Date type)
duration:315532
_class:"Inviter Record"
我有简单的 startDate 索引(ASC)按查询{startDate: 1}
性能(使用解释)和索引对我的文档进行排序:
执行时间Millis:977
没有:
执行时间Millis:356
我期待相反的结果
解决方案
我搞砸了(使用没有索引的 500k 文档排序我实际上得到了 300+- milisec,但我也得到了 executionStatus: false 错误,比如你不能在 RAM 中保存超过 32mb 的数据,请使用索引
推荐阅读
- angular - 角度拖放交点(例如表格中的行和列)
- python - 如何使用openpyxl将一个excel文件的列值与Python中另一个excel文件的列值进行比较?
- java - 为什么我必须使用 this 关键字来初始化构造函数中的实例变量?
- node.js - 访问文件夹中的所有文件
- google-apps-script - 根据列值将 Google 表格拆分为多个选项卡
- list - Flutter Navigator - 如何传递 DocumentSnapshot
- 到详情页?
- pyspark - 在 Pyspark 中创建单词及其位置
- python - 导入 Dash 时出错:“ImportError:导入 _brotli 时 DLL 加载失败:找不到指定的模块。”
- python - 函数中的参数
- c++ - 通过 TCP 套接字发送文件 C++ | 视窗