Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
2.4.6
-
ALL
-
Description
Sorting a result by a single field on a find() or aggregate() result that uses geoNear or geoWithin and limiting the result (e.g. to 1,000 documents) yields a very slow response time. Running explain shows scanAndOrder=true and a very high number of scanned documents.
If you remove the geoNear/geoWithin and get the whole collection, the sort is very fast, and explain shows scanAndOrder=false and a number of low number of scanned documents, which is equal to the limit specified.
Attachments
Issue Links
- related to
-
DOCS-3338 Improve $near and geoNear pages to mention additional sort is not efficient
-
- Closed
-