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

$within query with sort very slow

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Blocker - P1 Blocker - P1
    • None
    • 2.2.1
    • Geo, Querying
    • None
    • Ubuntu 64bit in Amazon

    Description

      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?

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: