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

$or should choose SORT_MERGE instead of OR if all children provide the same sort

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
    • Query

      We only choose a SORT_MERGE stage to combine or-clauses if there is a sort requested and all children can provide the sort. However, we could use a SORT_MERGE stage if all children provide the same sort, even if it is not the sort requested, or there is no sort requested. We look for a sort shared by all children here.

      This suggested improvement is assuming that a SORT_MERGE stage is always better than an OR stage in terms of performance or memory usage.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: