incorrect nscannedObjects for $or

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.5.5
    • Component/s: Querying
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Saw this in repro'ing SERVER-12613. Stripped down version below.

      db.col.drop();
      db.col.insert({a:"test"});
      db.col.ensureIndex({a:1});
      
      var explainObj = db.col.find({ $or: [ { 'a' : "foo" }, { 'a' : "bar" } ] }).explain();
      printjson( explainObj )
      assert.eq(0, explainObj.nscannedObjectsAllPlans);
      assert.eq(0, explainObj.nscannedAllPlans);
      
      db.col.getPlanCache().clear();
      
      explainObj = db.col.find({ $or: [ { 'a' : null }, { 'a' : null } ] }).explain();
      printjson( explainObj )
      assert.eq(0, explainObj.nscannedObjectsAllPlans);
      assert.eq(0, explainObj.nscannedAllPlans);
      

              Assignee:
              Benety Goh
              Reporter:
              Daniel Pasette (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: