-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.0
-
Component/s: Querying
-
None
-
Environment:Ubuntu and OSX 10.8
-
ALL
Issuing a query such as:
db.events.find({$query : {$or : [{foo : {$in : []}}, {bar : {$in : []}}]}, $orderby : {_id : 1}})
on a reasonably large table (my events table has 1.2million entries, each using around 6.5k), then the query takes a long time to return (approx 1 minute).
Reducing the number of OR clauses to one, and it returns immediately. Extend the number of OR clauses to 3, and it never returns (at least, not that I've waited for!)
Remove the orderby and they all return instantly.
Note that the documents in my events table has neither a foo or a bar field, so I suspect this is easy to reproduce on any reasonably sized table.
- duplicates
-
SERVER-1205 $or sort does not use index ranges expressed in or clauses
- Closed