I have a MongoDB request that I am trying to optimize. I created an index that matches the fields in the query, but I cannot force the MongoDB query planner to use the index without an explicit one hint(), even if nscannedit’s millibetter for the intended version.
Here are the indexes, the query (with and without a hint) and a detailed explanation:
http://paste.roguecoders.com/p/4face5649612e840da04c5fea0491c9b.txt
One extra bit of information: this index is in a collection of a large number, in a set of replicas, so I built the index using a stand-alone method . Now it is present in all nodes.
(Originally published by MongoDB-User .)
source
share