了解Mongo DB的说明

编程入门 行业动态 更新时间:2024-10-26 12:22:56
本文介绍了了解Mongo DB的说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我触发了一个查询,并试图在mongo控制台上对其进行解释并得到

I fired a query and tried to explain it on mongo console and got

"isMultiKey" : true, "n" : 8, "nscannedObjects" : 17272, "nscanned" : 17272, "nscannedObjectsAllPlans" : 21836, "nscannedAllPlans" : 21836, "scanAndOrder" : true, "indexOnly" : false, "nYields" : 0, "nChunkSkips" : 0, "millis" : 184,

大多数内容在 www.mongodb/display/DOCS中进行了解释/说明,但是我不明白nscannedAllPlans是什么意思,nscannedAllPlans是什么意思.有人可以帮忙吗?

Most of the things are explained in www.mongodb/display/DOCS/Explain, but I cannot understand what does nscannedObjectsAllPlans, nscannedAllPlans means. Can anyone help?

谢谢

推荐答案

nscanned和nscannedObjects报告获胜计划的结果.

nscanned and nscannedObjects report results for the winning plan.

nscannedAllPlans和nscannedObjectsAllPlans报告所有计划的结果

nscannedAllPlans and nscannedObjectsAllPlans report results for all plans

例如:

>t = db.jstests_explainb; >t.drop(); >t.ensureIndex( { a:1, b:1 } ); >t.ensureIndex( { b:1, a:1 } ); >t.save( { a:0, b:1 } ); >t.save( { a:1, b:0 } ); >t.find( { a:{ $gte:0 }, b:{ $gte:0 } } ).explain( true ); { "cursor": "BtreeCursor a_1_b_1", "isMultiKey": false, "n": 2, "nscannedObjects": 2, "nscanned": 2, "nscannedObjectsAllPlans": 6, "nscannedAllPlans": 6, "scanAndOrder": false, "indexOnly": false, "nYields": 0, "nChunkSkips": 0, "millis": 2, ... }

更多推荐

了解Mongo DB的说明

本文发布于:2023-11-22 21:04:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619016.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Mongo   DB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!