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

incorrect nscannedObjects for $or

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

      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@mongodb.com Benety Goh
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: