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

geoNear results has incorrect nscanned

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Geo
    • Labels:
    • Environment:
      Windows x64 build from 12/30
    • ALL
    • Hide

      > db.testcollection.find()

      { "_id" : ObjectId("52c326adbc71171da4a9a068"), "Location" : [ 1, 1 ], "Name" : "One", "Type" : "Museum" } { "_id" : ObjectId("52c326adbc71171da4a9a069"), "Location" : [ 1, 2 ], "Name" : "Two", "Type" : "Coffee" } { "_id" : ObjectId("52c326adbc71171da4a9a06a"), "Location" : [ 1, 3 ], "Name" : "Three", "Type" : "Library" } { "_id" : ObjectId("52c326adbc71171da4a9a06b"), "Location" : [ 1, 4 ], "Name" : "Four", "Type" : "Museum" } { "_id" : ObjectId("52c326adbc71171da4a9a06c"), "Location" : [ 1, 5 ], "Name" : "Five", "Type" : "Coffee" }

      > db.testcollection.getIndexes()
      [
      {
      "v" : 1,
      "key" :

      { "_id" : 1 }

      ,
      "name" : "id",
      "ns" : "csharpdriverunittests.testcollection"
      },
      {
      "v" : 1,
      "key" :

      { "Location" : "2d" }

      ,
      "name" : "Location_2d",
      "ns" : "csharpdriverunittests.testcollection"
      }
      ]
      >

      Show
      > db.testcollection.find() { "_id" : ObjectId("52c326adbc71171da4a9a068"), "Location" : [ 1, 1 ], "Name" : "One", "Type" : "Museum" } { "_id" : ObjectId("52c326adbc71171da4a9a069"), "Location" : [ 1, 2 ], "Name" : "Two", "Type" : "Coffee" } { "_id" : ObjectId("52c326adbc71171da4a9a06a"), "Location" : [ 1, 3 ], "Name" : "Three", "Type" : "Library" } { "_id" : ObjectId("52c326adbc71171da4a9a06b"), "Location" : [ 1, 4 ], "Name" : "Four", "Type" : "Museum" } { "_id" : ObjectId("52c326adbc71171da4a9a06c"), "Location" : [ 1, 5 ], "Name" : "Five", "Type" : "Coffee" } > db.testcollection.getIndexes() [ { "v" : 1, "key" : { "_id" : 1 } , "name" : " id ", "ns" : "csharpdriverunittests.testcollection" }, { "v" : 1, "key" : { "Location" : "2d" } , "name" : "Location_2d", "ns" : "csharpdriverunittests.testcollection" } ] >

      db.runCommand(

      {geoNear:"testcollection" , near : [0,0], limit:100,maxDistance: 100,distanceMultipler:1}

      )
      nscanned is 0 when in 2.4.8 has it as 5.
      Additionally the ns field is missing in the latest results and the stats field in the result differs from 2.4.8. This is causing some of the .Net driver tests to fail with the latest build.

      db.runCommand({geoNear:"testcollection" , near : [0,0], limit:100,maxDistance:
      100,distanceMultipler:1}).stats
      

      2.4.8
      {
      "time" : 2,
      "btreelocs" : 0,
      "nscanned" : 5,
      "objectsLoaded" : 5,
      "avgDistance" : 3.2069368678503425,
      "maxDistance" : 5.09903122655428
      }

      2.5.4
      {
      "btreelocs" : 0,
      "nscanned" : 5,
      "objectsLoaded" : 5,
      "avgDistance" : 3.2069368678503425,
      "maxDistance" : 5.09903122655428,
      "time" : 4
      }

      12/30 build
      {
      "nscanned" : NumberLong(0),
      "objectsLoaded" : NumberLong(5),
      "avgDistance" : 3.2069368678503425,
      "maxDistance" : 5.0990195135927845,
      "time" : 3
      }

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            sridhar Sridhar Nanjundeswaran
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: