Optimize-away more $projects before $group

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • 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:
            2 Start watching this issue

              Created:
              Updated: