Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31148

The executionTimeMillis in explain is a lot different from the actual execution time

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 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

            Assignee:
            mark.agarunov Mark Agarunov
            Reporter:
            MaJinliang MaJinliang [X]
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: