-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
Labels:None
-
Environment:Linux
db.Trade.find({ 'startDate': {$lte: ISODate("2017-09-08T00:00:00.000Z")}, $or: [ { 'endDate': {$gte: ISODate("2017-09-08T00:00:00.000Z")} }, { 'endDate': {$exists: false} } ] }).sort({'date': -1}).limit(100).explain('executionStats')
There are indexes in startDate_1_endData_1 and data_1
As the executionStats description, the query will use the data_1 index.
In executionStats, it run 3s, but actually, it run 80s