Simple MongoDB query very slow although index is set

前端 未结 3 526
独厮守ぢ
独厮守ぢ 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

    I would try setting a non-unique index on _reference_2_id, because at the moment, I suspect you'll be doing the equivalent of a full table scan as even though the indexes contain _reference_2_id, they won't be used (see here).

提交回复
热议问题