Slow MongoDB query: can you explain why?

前端 未结 1 541
被撕碎了的回忆
被撕碎了的回忆 2021-01-14 05:33

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 ~
1条回答
  •  伪装坚强ぢ
    2021-01-14 06:12

    Missing the index on the private key?

    BtreeCursor owner_1_avatar_1_date_-1 vs .find({ owner: "123", avatar: false, private: false }).sort({date: -1})

    0 讨论(0)
提交回复
热议问题