MongoDB学习之旅十九:explain执行计划
2014-04-18 11:04
639 查看
MongoDB 提供了一个 explain 命令让我们获知系统如何处理查询请求。利用 explain 命令,我们可以很好地观察系统如何使用索引来加快检索,同时可以针对性优化索引。
cursor: 返回游标类型(BasicCursor 或 BtreeCursor)
nscanned: 被扫描的文档数量
n: 返回的文档数量
millis: 耗时(毫秒)
indexBounds: 所使用的索引
> db.t5.ensureIndex({name:1}) > db.t5.ensureIndex({age:1}) > db.t5.find({age:{$gt:45}}, {name:1}).explain() { "cursor" : "BtreeCursor age_1", "nscanned" : 0, "nscannedObjects" : 0, "n" : 0, "millis" : 0, "nYields" : 0, "nChunkSkips" : 0, "isMultiKey" : false, "indexOnly" : false, "indexBounds" : { "age" : [ [ 45, 1.7976931348623157e+308 ] ] } }字段说明:
cursor: 返回游标类型(BasicCursor 或 BtreeCursor)
nscanned: 被扫描的文档数量
n: 返回的文档数量
millis: 耗时(毫秒)
indexBounds: 所使用的索引
相关文章推荐
- BeginPaint和GetDC有什么区别?
- 重写controller的CloseAndSave方法(点击关闭时关闭整个Detail View)
- UVa 11168 Airport 凸包
- Climbing Stairs -- LeetCode
- WHU-1551-Pairs(莫队算法+分块实现)
- 做Raid10的两种方法
- paip.数据挖掘--导出词库 清理太长的iptcode
- paip.数据挖掘--导出词库 清理太长的iptcode
- raid10+quota
- paip.解决中文url路径的问题图片文件不能显示
- paip.解决中文url路径的问题图片文件不能显示
- raid10 + lvm + quota (/home)
- ObjC的Retain的属性和Copy的区别
- HDU 1039 Easier Done Than Said?
- ural 1017. Staircases(dp)
- 网络爬虫C实现http://blog.csdn.net/xu3737284/article/details/9614933
- 【LeetCode】Container With Most Water
- MFC多线程失败:Create Instance failed
- Amazon Seller Central is Temporarily Unavailable
- TIME_WAIT