[SERVER-12229] geoNear results has incorrect nscanned Created: 31/Dec/13  Updated: 10/Dec/14  Resolved: 08/Jan/14

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Sridhar Nanjundeswaran Assignee: hari.khalsa@10gen.com
Resolution: Duplicate Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows x64 build from 12/30


Issue Links:
Duplicate
duplicates SERVER-12231 explain() for GeoSearchCursor broken Closed
Operating System: ALL
Steps To Reproduce:

> 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"
}
]
>

Participants:

 Description   

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
}



 Comments   
Comment by Craig Wilson [ 10/Jan/14 ]

Nested in this ticket is also a report that the results from a geoNear command are different. They used to contain the "ns" field and no longer do.

>> 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.

Arguably, this should be a different ticket.

Comment by Daniel Pasette (Inactive) [ 08/Jan/14 ]

dup: SERVER-12231

Generated at Thu Feb 08 03:27:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.