-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.6.0
-
Component/s: Querying
-
None
-
ALL
-
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
When using an $in clause which has more entries than specified by limit() (with an index), the server can stop scanning the index and return the results as soon as the desired number of results have been obtained. This is particularly useful when using $in with limit(1), ie. "just find me a document that matches one of these".
The limit(1) case works (ie. nscanned == limit) in version 2.4, but not 2.6. For limits > 1, both versions 2.4 and 2.6 scan slightly more than necessary (nscanned > limit), but 2.4 is a little better than 2.6.