Extend $unwind+$group to DISTINCT_SCAN optimization to support $match

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Follow-up from SERVER-37715

      Supported scenarios, given a compatible index:

      • $unwind+$match+$group since the filter applies to every element in the array, corresponding to index keys
      • $match+$unwind+$group on a non-multikey index (though I imagine it's uncommon to have queries like this)

      This change will also make eligible $unwind+$group queries use multiplanning, so we should make sure to add relevant tests

            Assignee:
            Unassigned
            Reporter:
            Henri Nikku
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: