Non covered geo query is reported as a covered query

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.4.0
    • Component/s: Geo, Querying
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The test below shows indexOnly=true and nscannedObjects=0.

      var coll = db.getCollection("covered_geo_2")
      coll.drop()
      
      coll.insert({_id : 1, loc1 : [ 5 , 5 ], type1 : "type1", loc2 : [ 5 , 5 ], type2 : 1})
      coll.insert({_id : 2, loc1 : [ 6 , 6 ], type1 : "type2", loc2 : [ 5 , 5 ], type2 : 2})
      coll.insert({_id : 3, loc1 : [ 7 , 7 ], type1 : "type3", loc2 : [ 5 , 5 ], type2 : 3})
      
      coll.ensureIndex({loc1 : "2dsphere", type1 : 1});
      coll.ensureIndex({type2: 1, loc2 : "2dsphere"});
      
      var plan = coll.find({type2 : {$lt:3}}, {type2:1, loc2:1, _id:0}).hint({type2: 1, loc2:"2dsphere"}).explain();
      assert.eq(false, plan.indexOnly, "geo.2.3 - indexOnly should be false for a covered query")
      assert.neq(0, plan.nscannedObjects, "geo.2.3 - nscannedObjects should be 0 for a covered query")
      

            Assignee:
            David Storch
            Reporter:
            Sridhar Nanjundeswaran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: