.last/.first should not add _id: 1 sorting in some cases

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In case when there any other sorting conditions in current Criteria scope, Mongoid should not add _id: 1 ordering options, on "first" and "last" calls, because this can cause selection without using indexes, and cause performance degradation on large collections.

      Also, I think it will be better use natural ordering instead of just sorting by primary keys, since there no such thing like "first" or "last" record in mongo collections.

              Assignee:
              Unassigned
              Reporter:
              y8
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: