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

Improve the way indexes are used to do a range query on one field and sort on another

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Index Maintenance
    • None
    • ALL

    Description

      The "Equality, Range Query, And Sort" section of Jesse's blog post here describes how if you do a range query on one field and sort on another you have to choose between lowering your nscanned or getting rid of the in-memory sort. If you put the sort key first, you get rid of the in-memory sort, but at the cost of higher nscanned. If you put the sort key last, however, you can get nscanned down to exactly n, but you'll have to do an in-memory sort.

      Attachments

        Activity

          People

            Unassigned Unassigned
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: