$within query with sort very slow

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Blocker - P1
    • None
    • Affects Version/s: 2.2.1
    • Component/s: Geo, Querying
    • None
    • Environment:
      Ubuntu 64bit in Amazon
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We're using mongo vie spring data and everything else seems to working aok except one geo-query. We're trying to run a bounding box query and sort it so that we only get 50 newest records. For some reason, if we don't specify $sort, all of the coordinates will be in a same very small area. I assume that Query query = new Query(where("loc").within(searchbox)) is sorting the results by distance? Then if we specify the sort-object like query.with(new Sort(Sort.Direction.ASC, "another")) the query will be slowest of the slow. We've created a combound index for that query.

      Could someone please help?

            Assignee:
            hari.khalsa@10gen.com
            Reporter:
            Jari Rangell
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: