本文介绍了了解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的说明
发布评论