[SERVER-8957] Explain on 2dsphere find query includes "nscanned" twice, and some other inconsistencies Created: 12/Mar/13  Updated: 21/Aug/14  Resolved: 21/Aug/14

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

Type: Bug Priority: Minor - P4
Reporter: Thomas Rueckstiess Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-10448 Revamp explain() formatting Closed
Operating System: ALL
Participants:

 Description   

Steps to reproduce:

db.places.drop()
db.places.ensureIndex({loc: "2dsphere"})
db.places.insert({loc: {type: "Point", coordinates: [10, 10] }, name: "restaurant"})
db.places.find({loc: {"$geoWithin": {"$geometry": {type: "Polygon", coordinates: [ [ [5, 5], [12, 8], [10, 15], [5, 5] ] ] } } } }).explain()

Returns:

{
	"cursor" : "S2Cursor",
	"isMultiKey" : true,
	"n" : 1,
	"nscannedObjects" : 1,
	"nscanned" : 2,
	"nscannedObjectsAllPlans" : 1,
	"nscannedAllPlans" : 2,
	"scanAndOrder" : false,
	"indexOnly" : false,
	"nYields" : 0,
	"nChunkSkips" : 0,
	"millis" : 1,
	"indexBounds" : {
		
	},
	"nscanned" : 2,
	"matchTested" : NumberLong(1),
	"geoTested" : NumberLong(1),
	"cellsInCover" : NumberLong(13),
	"server" : "capslock.local:27017"
}

Do they have different meanings? Or should one be removed?

It's also strange that the value is 2, when I only have 1 document in the collection. Is that a property of the 2dsphere index? Or multi-key?

Lastly, why do matchTested, geoTested, cellsInCover output their values as NumberLong(..) values?



 Comments   
Comment by Thomas Rueckstiess [ 21/Aug/14 ]

No longer present in 2.6. Closing.

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