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

incorrect nscannedObjects for $or

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.5.5
    • Querying
    • None
    • ALL

    Description

      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);

      Attachments

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: