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

Optimize away unused computed fields

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

      When we compute a new field from an expression (in a $set / $addFields / $project stage), and then that field is ignored or discarded later, we could avoid computing it in the first place.  When optimizing a $set stage, we could use getDependencies() on the pipeline suffix to decide which fields are actually dead code.

      We could do a similar thing for $group (and $setWindowFields).  This may have an even bigger impact, since accumulators and window functions can use a lot of space.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: