Similar queries yet horrible performance for one of them

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Incomplete
    • Priority: Critical - P2
    • None
    • Affects Version/s: 3.2.13
    • Component/s: Index Maintenance
    • None
    • Environment:
      MongoDB v3.2.13
      3-nodes cluster in MongoDB Cloud, M10 instances
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have two queries that are strictly identical, except for one field.

      Query 1: "fieldX":

      { $in: [ "value1", "value2", "value3", "value4", "value5" ] }

      Query 2: "fieldX": "value6"

      Query 1 takes 2 seconds to execute.
      Query 2 takes 5.87 seconds to execute.

      Important information: my cluster has crashed a week ago during the creation of the index that is used by the queries. The MongoDB Cloud team restarted its 3 nodes.

      Attached are screenshots of the two queries and their execution times as displayed by Robomongo.

      Any ideas?

        1. 1.png
          80 kB
          Elyes Gherib
        2. 2.png
          77 kB
          Elyes Gherib
        3. explain1.json
          105 kB
          Elyes Gherib
        4. explain2.json
          96 kB
          Elyes Gherib
        5. index.json
          0.3 kB
          Elyes Gherib

            Assignee:
            Unassigned
            Reporter:
            Elyes Gherib
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: