Simple MongoDB query very slow although index is set

前端 未结 3 520
独厮守ぢ
独厮守ぢ 2021-01-21 04:01

I\'ve got a MongoDB collection that holds about 100M documents.

The documents basically look like this:

_id             : ObjectId(\"asd1234567890\")
_re         


        
3条回答
  •  清酒与你
    2021-01-21 05:06

    Hye, I've quiet the same problem on an equivalent amount of datas. In the documentation, it's written that queries with index must fit in ram. I think this is not the case, the query must be doing a lot of disk access to first retrieve the index and then get the value. In your case, a direct collection read will be faster.

    EV.

提交回复
热议问题