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

Enable match pushdown when predicates in the previous stage and the $match stage are independent but have the same name

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

      Currently, the `splitMatchExpressionBy` function will mark part of a match stage as ineligible for pushdown if the filter path and the paths required by the previous stage contain dependencies. For instance, in the following pipeline:

      [{$replaceWith: '$subDocument'},
       {$match: {'subDocument.x': 2}}

      the $match stage will not be pushed down because 'subDocument' and 'subDocument.x' are marked as dependent, even though the fields are independent in the document and simply have the same name:

      {subDocument: {subDocument: x}}

      We should improve the analysis of the `containsDependency` helper to recognize when a field is independent of and simply has the same/overlapping name as a field in an earlier stage.

            Assignee:
            Unassigned Unassigned
            Reporter:
            lynne.wang@mongodb.com Lynne Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: