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

db.collection.explain() is taking a very long time

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.2.11
    • Performance
    • None
    • Fully Compatible

    Description

      Some find operations on a mongodb sharded cluster we have are very slow, and when running a db.collection.explain() to figure out how which is the execution plan is also taking a very long time to execute (more than 30 minutes).

      The command we are issuing to obtain the explain plan is the following:

      db.ocs.explain().find({ "site": 1, $and: [ { "TID": { $gte: 195411511, $lte: 198134790 } }, { $and: [ { "adrTyp": "topup" }, { $and: [ { "strDate": { $gte: ISODate("2017-10-24T15:00:00.000+0000"), $lte: ISODate("2017-10-24T16:00:00.000+0000") } }, { $and: [ { "ocs.res.ocs": { $gte: 12, $lte: 14 } }, { $and: [ { "chn": "MULA" } ] } ] } ] } ] } ] })
      

      Is this a normal behavior? how can we understand why the explain command is taking so long?

      Attachments

        1. mongo_query_explain_true.txt
          138 kB
        2. mongo_query_explain.txt
          78 kB

        Activity

          People

            dmitry.agranat@mongodb.com Dmitry Agranat
            gamaro Guilherme Amaro
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: