Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8390

If you call count on a $near query it looks at all points, and is slow.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.3.2
    • Component/s: Geo
    • None
    • ALL

      Working with ny openstreetview data (can be found in mongo-snippets/2dsphere/data) which results in 366440 entries.

      When doing a db.ny.find().count(), it returns instantly.

      If I do a db.ny.find({geo: {$near: {$geometry: {type: "Point", coordinates [any lng, lat ]}}}}).count()

      it hangs for a long time, and eats all of my memory.

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            ian.bentley Ian Bentley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: