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

Covered query on a compound index that does not yield any results does not have indexOnly = true

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      2.4.0-rc0 on OS X
    • ALL
    • Hide

      var coll = db.getCollection("covered_compound_1")
      coll.drop()
      for (i=0;i<100;i++) {
      coll.insert(

      {a:i, b:"strvar_"+(i%13), c:NumberInt(i%10)}

      )
      }
      coll.insert
      coll.ensureIndex(

      {a:1,b:-1,c:1}

      )
      // Test no result
      var plan = coll.find(

      {a:38, b:"strvar_12", c:55}

      ).hint(

      {a:1, b:-1, c:1}

      ).explain()
      assert.eq(true, plan.indexOnly, "compound.1.7 - indexOnly should be true on covered query")

      Show
      var coll = db.getCollection("covered_compound_1") coll.drop() for (i=0;i<100;i++) { coll.insert( {a:i, b:"strvar_"+(i%13), c:NumberInt(i%10)} ) } coll.insert coll.ensureIndex( {a:1,b:-1,c:1} ) // Test no result var plan = coll.find( {a:38, b:"strvar_12", c:55} ).hint( {a:1, b:-1, c:1} ).explain() assert.eq(true, plan.indexOnly, "compound.1.7 - indexOnly should be true on covered query")

      Covered index query which does not return a result does not have indexOnly=true

            Assignee:
            Unassigned Unassigned
            Reporter:
            sridhar Sridhar Nanjundeswaran
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: