以下是来自地理空间索引的约200万份文档集合的geo-$ near查询示例,这些文档需要将近半秒钟才能在200米半径范围内找到文档。
rs-[SNIP]:PRIMARY> db.photograph.find({'!geo': { $near: { $geometry: { coordinates: [-71.091246, 42.361474], type: 'Point' }, $maxDistance: 200 }}}).limit(100).explain();
{
"cursor" : "S2NearCursor",
"isMultiKey" : false,
"n" : 100,
"nscannedObjects" : 3914,
"nscanned" : 59115,
"nscannedObjectsAllPlans" : 3914,
"nscannedAllPlans" : 59115,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 462,
"nChunkSkips" : 0,
"millis" : 418,
"indexBounds" : {
},
"server" : "[SNIP]",
"filterSet" : false
}
我的问题: