Mongo 2.6.12辅助节点不使用索引

时间:2016-04-20 01:14:24

标签: mongodb indexing replicaset

我们最近将我们的mongo副本集从2.4升级到2.6.12,并且有一个奇怪的行为,即主要使用索引而辅助副本没有。

例如此查询:

query fitly_metrics_production.rank_ledger_entries query: { $query: { 
user_id: ObjectId('56dd084df093a136580be18a'), category: "chest" }, 
$orderby: { _id: -1 } } planSummary: IXSCAN { _id: 1 } ntoskip:0 
nscanned:1645536 nscannedObjects:1645536 keyUpdates:0 numYields:12866 
locks(micros) r:138352610 nreturned:1 reslen:316 481856ms

在我们看到的同一个框上运行explain()时

{
"cursor" : "BtreeCursor user_id_1_category_1",
"isMultiKey" : false,
"n" : 9,
"nscannedObjects" : 9,
"nscanned" : 9,
"nscannedObjectsAllPlans" : 30,
"nscannedAllPlans" : 30,
"scanAndOrder" : true,
"indexOnly" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 0,
"indexBounds" : {
    "user_id" : [
        [
            ObjectId("56dd084df093a136580be18a"),
            ObjectId("56dd084df093a136580be18a")
        ]
    ],
    "category" : [
        [
            "chest",
            "chest"
        ]
    ]
},
"server" : "ip-10-7-2-11:27017",
"filterSet" : false
}

当在主要版本上运行时,它确实正确地命中了索引,我们有两个辅助文件,这是在两个辅助文件上发生的。

知道发生了什么事吗?感谢。

0 个答案:

没有答案
相关问题