-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6.9, 3.0.2
-
Component/s: Querying
-
Environment:Ubuntu 12.04
-
Fully Compatible
-
Linux
-
-
Query F (02/01/16), Query 10 (02/22/16)
IndexScanNode::computeProperties() computes sort orders provided by the index scan. It obtains some of these sort orders by looking at the contents of its IndexBounds instance. However, it fails to compute some obvious sort orders when isSimpleRange is true. As a result, plans for .min()/.max() queries may involve an unnecessary in-memory SORT stage.
Original Description
We currently run a sharding in production in 2.4.13 with a fairly large collection and a compound multikey index. We met the problem with multi key index with unbound limit that we solved using cursor.min and cursor.max.
But after upgrading to 2.6.9, we realized that the behavior between the two versions has changed. MongoDB uses the correct index but specifies a scanAndOrder to true even if the index is well sorted.
I have asked the question on stackoverflow but didn't receive so far any answers.
http://stackoverflow.com/questions/29679635/behavior-has-changed-between-mongodb-2-4-and-2-6-for-cursor-min-max
- is related to
-
SERVER-15086 Allow for efficient range queries over non-array fields in multikey indices
- Closed