Default $orderby _id:1 on where() causing HUGE performance issues

XMLWordPrintableJSON

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

      On Mongoid 4 / Moped 2 stable, I am seeing crazy performance issues when $orderby:

      { _id: 1 }

      is used on a where statement that is doing an $or and looking for a single record. With $orderby its 40 seconds, without it, the same query goes to 1ms.

      I checked all of my code and I am not setting a default scope to order by _id anywhere.

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

                Created:
                Updated:
                Resolved: