Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


slow mongodb query can you explain why


slow mongodb query can you explain why  using -'performance,mongodb,indexing,profiler'

I have a MongoDB query that's taking an unreasonably long time to run, but it:


is only scanning 6 objects
hits an index
consistently takes ~1500ms (wasn't paging or otherwise occupied)
index miss% is 0 in mongostat


It showed up in the profiler (without the explain()), and I don't understand why it's so slow. Any ideas?

gimmebar:PRIMARY> db.assets.find({ owner: "123", avatar: false, private: false }).sort({date: -1}).explain()
{
    "cursor" : "BtreeCursor owner_1_avatar_1_date_-1",
    "nscanned" : 6,
    "nscannedObjects" : 6,
    "n" : 6,
    "millis" : 1567,
    "nYields" : 0,
    "nChunkSkips" : 0,
    "isMultiKey" : false,
    "indexOnly" : false,
    "indexBounds" : {
        "owner" : [
            [
                "123",
                "123"
            ]
        ],
        "avatar" : [
            [
                false,
                false
            ]
        ],
        "date" : [
            [
                {
                    "$maxElement" : 1
                },
                {
                    "$minElement" : 1
                }
            ]
        ]
    }
}

    

asked Oct 13, 2015 by kotmus2002
0 votes
5 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...