mongodb 2.6.8中的慢计数

mongodb 2.6.8中的慢计数,mongodb,count,Mongodb,Count,我有一个查找请求,需要0.031秒,但是当我尝试使用计数执行相同的请求时,它需要1秒 我尝试了不同的索引,但问题总是一样的。 计数仍然很慢 有什么想法吗 卷 160万份文件 我的要求 我的索引 说明 看看这里:你好,谢谢你的回答,但我已经读过这篇文章了。这个问题似乎在2.3.2 jira.mongodb.org/browse/SERVER-1752中得到了解决,但我使用的是mongo 2.6.8,我在mongo 2.4.9上使用了相同的数据和索引尝试了我的请求。计数需要0.6秒!mongo 2.

我有一个查找请求,需要0.031秒,但是当我尝试使用计数执行相同的请求时,它需要1秒

我尝试了不同的索引,但问题总是一样的。 计数仍然很慢

有什么想法吗

卷 160万份文件

我的要求

我的索引

说明


看看这里:你好,谢谢你的回答,但我已经读过这篇文章了。这个问题似乎在2.3.2 jira.mongodb.org/browse/SERVER-1752中得到了解决,但我使用的是mongo 2.6.8,我在mongo 2.4.9上使用了相同的数据和索引尝试了我的请求。计数需要0.6秒!mongo 2.6.8中有一个回归?您好,我的服务器似乎运行不正常。我在本地安装mongodb 2.6.8,并在服务器上运行mongorestore。计数请求并不慢,并且响应的持续时间与mongodb 2.4.9相同
db.books.find(
{
    "categories" : { $eq : null},
    "theme" : "comics"
}
)
{
    "categories" : 1,
    "theme" : 1

}
{
    "cursor" : "BtreeCursor categories_1_theme_1",
    "isMultiKey" : false,
    "n" : 353912,
    "nscannedObjects" : 353912,
    "nscanned" : 353912,
    "nscannedObjectsAllPlans" : 354821,
    "nscannedAllPlans" : 354821,
    "scanAndOrder" : false,
    "indexOnly" : false,
    "nYields" : 2771,
    "nChunkSkips" : 0,
    "millis" : 1111,
    "indexBounds" : {
        "theme" : [
            [
                "comics",
                "comics"
            ]
        ],
        "categories" : [
            [
                null,
                null
            ]
        ]
    },
    "server" : "xxxmongoxxx:27017",
    "filterSet" : false,
    "stats" : {
        "type" : "KEEP_MUTATIONS",
        "works" : 353913,
        "yields" : 2771,
        "unyields" : 2771,
        "invalidates" : 0,
        "advanced" : 353912,
        "needTime" : 0,
        "needFetch" : 0,
        "isEOF" : 1,
        "children" : [
            {
                "type" : "FETCH",
                "works" : 353913,
                "yields" : 2771,
                "unyields" : 2771,
                "invalidates" : 0,
                "advanced" : 353912,
                "needTime" : 0,
                "needFetch" : 0,
                "isEOF" : 1,
                "alreadyHasObj" : 0,
                "forcedFetches" : 0,
                "matchTested" : 353912,
                "children" : [
                    {
                        "type" : "IXSCAN",
                        "works" : 353913,
                        "yields" : 2771,
                        "unyields" : 2771,
                        "invalidates" : 0,
                        "advanced" : 353912,
                        "needTime" : 0,
                        "needFetch" : 0,
                        "isEOF" : 1,
                        "keyPattern" : "{ categories: 1, theme: 1 }",
                        "isMultiKey" : 0,
                        "boundsVerbose" : "field #0['categories']: [\"comics\", \"comics\"], field #1['theme']: [null, null]",
                        "yieldMovedCursor" : 0,
                        "dupsTested" : 0,
                        "dupsDropped" : 0,
                        "seenInvalidated" : 0,
                        "matchTested" : 0,
                        "keysExamined" : 353912,
                        "children" : []
                    }
                ]
            }
        ]
    }
}