-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.6.0-rc1
-
Component/s: Geo, Performance
-
ALL
-
Some geo-spatial queries in 2.6-rc1 scan a lot more documents than older versions. I have a 1.8 million doc collection. In 2.4, the query scans 440K rows, in 2.6, the query scans 1.4 million rows
===== 2.4 ====
> db.ps.find({'PROV_TIN_ADR.LATLONGDEGREE':{$near:{$geometry:
, $maxDistance :482803}}}).limit(300).explain()
{
"cursor" : "S2NearCursor",
"isMultiKey" : true,
"n" : 300,
"nscannedObjects" : 300,
"nscanned" : 441680,
"nscannedObjectsAllPlans" : 300,
"nscannedAllPlans" : 441680,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 696,
"indexBounds" : {
},
"nscanned" : 441680,
"matchTested" : NumberLong(32280),
"geoMatchTested" : NumberLong(32280),
"numShells" : NumberLong(8),
"keyGeoSkip" : NumberLong(409400),
"returnSkip" : NumberLong(3),
"btreeDups" : NumberLong(0),
"inAnnulusTested" : NumberLong(32280),
"server" : "apxxx:27017"
}
=============== 2.6.rc1 ======================
db.ps.find({'PROV_TIN_ADR.LATLONGDEGREE':{$near:{$geometry:
{type : "Point" ,coordinates : [-78.898619,35.9940329] } , $maxDistance :482803}}}).limit(300).explain()
{
"cursor" : "S2NearCursor",
"isMultiKey" : false,
"n" : 300,
"nscannedObjects" : 1405044,
"nscanned" : 1405044,
"nscannedObjectsAllPlans" : 1405044,
"nscannedAllPlans" : 1405044,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 10976,
"nChunkSkips" : 0,
"millis" : 8552,
"indexBounds" : {
},
"server" : "apxxx:27017",
"filterSet" : false
}