"Shard results differ" warning when sharding is not used

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.29.4
    • Affects Version/s: None
    • Component/s: Explain
    • None
    • 3
    • Iteration Minsk
    • Not Needed
    • None

      for (let i = 0; i < 10000; i++) db.coll.insertOne({ a: ((Math.random() * 1000) | 0), b: ((Math.random() * 1000) | 0) });
      db.coll.createIndex({a:1})
      db.coll.createIndex({b:1})
      

      Then explain in Compass for a query like

      {$or:[{a:200},{b:300}]}
      

      will result in a “Shard results differ” warning message in the explain output because the server performs two index scans using different indexes, even though sharding is not involved.

              Assignee:
              Anna Henningsen
              Reporter:
              Anna Henningsen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: