[SERVER-16402] $nearSphere with 2dsphere index (S2NearCursor) shows incorrect statistics Created: 03/Dec/14  Updated: 24/Jan/15  Resolved: 13/Jan/15

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

Type: Bug Priority: Minor - P4
Reporter: Anil Kumar Assignee: David Storch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-16527 2dsphere explain reports "works" for ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

db.createCollection("c")
db.c.ensureIndex({xid: 1, pos: "2dsphere"})
db.c.find({xid: ObjectId("5475cdeeb307f5e9b8550e6d"), pos: { $nearSphere: [ 0, 0 ], $maxDistance: 0.1}}).explain()

Participants:

 Description   

This is evident from performing the query directly on an empty collection that does not contain any documents.

db.c.find({xid: ObjectId("5475cdeeb307f5e9b8550eaa"), pos: { $nearSphere: [ 0, 0 ], $maxDistance: 1}}).explain()

{
	"cursor" : "S2NearCursor",
	"isMultiKey" : false,
	"n" : 0,
	"nscannedObjects" : 26,
	"nscanned" : 26,
	"nscannedObjectsAllPlans" : 26,
	"nscannedAllPlans" : 26,
	"scanAndOrder" : false,
	"indexOnly" : false,
	"nYields" : 0,
	"nChunkSkips" : 0,
	"millis" : 8,
	"indexBounds" : {
		
	},
	"server" : "aks-osx.local:37018",
	"filterSet" : false
}

This issue is not seen in 2.8.



 Comments   
Comment by Daniel Pasette (Inactive) [ 13/Jan/15 ]

david.storch pointed out to me that this is a duplicate of SERVER-16527, scheduled for 2.6.8

Comment by Daniel Pasette (Inactive) [ 11/Jan/15 ]

This will be fixed in 2.8 with the work done to overhaul explain and will not be backported. See: SERVER-10448

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