db.tb3.find().explain('executionStats')
结果如下:
{
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "test.tb3",
"indexFilterSet" : false,
"parsedQuery" : {
},
"winningPlan" : {
"stage" : "COLLSCAN",
"direction" : "forward"
},
"rejectedPlans" : [ ]
},
"executionStats" : { // 执行计划相关统计信息
"executionSuccess" : true, // 执行成功的状态
"nReturned" : 3, // 返回结果集数量
"executionTimeMillis" : 0, // 执行所需的时间,毫秒
"totalKeysExamined" : 0, // 索引检查的时间
"totalDocsExamined" : 3, // 查询文档总数
"executionStages" : {
"stage" : "COLLSCAN", // 索引扫描方式(COLLSCAN 全表扫描;IXSCAN 索引扫描; FETCH 根据索引去检索指定document)
"nReturned" : 3, // 返回结果集数量
"executionTimeMillisEstimate" : 0, // 预估的执行时间,毫秒
"works" : 5, // 工作单元数,一个查询会被派生为一些小的工作单元
"advanced" : 3, // 优先返回的结果数量
"needTime" : 1,
"needYield" : 0,
"saveState" : 0,
"restoreState" : 0,
"isEOF" : 1,
"direction" : "forward", // 方向
"docsExamined" : 3 // 文档检查数量
}
},
"serverInfo" : {
"host" : "e8797fbe90f9",
"port" : 27017,
"version" : "4.4.2",
"gitVersion" : "15e73dc5738d2278b688f8929aee605fe4279b0e"
},
"ok" : 1
}
mongoDB索引分析
最新推荐文章于 2024-02-25 18:06:54 发布