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

Non covered geo query is reported as a covered query

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.4.0
    • Geo, Querying
    • None
    • ALL

    Description

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

      Attachments

        Activity

          People

            david.storch@mongodb.com David Storch
            sridhar Sridhar Nanjundeswaran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: