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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • None
    • None
    • None
    • None
    • 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")

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: