Optimize-away more $projects before $group

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-129906 handled the simplest cases. However, we should also extend the projection-removal logic to remove cases like this one:

      [
          {$project: {a: {$add: ["$b", "$c"]}, b:1}},
          {$group: {_id: "$b"}}
      ] 

      The trick here is that the $project involves the $b field that the $group uses, but its output it not read by the $group.

            Assignee:
            Steve Tarzia
            Reporter:
            Steve Tarzia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: