-
Type: Improvement
-
Resolution: Unresolved
-
Priority: 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.
- is depended on by
-
SERVER-56417 Optimize away unused 'output' fields in $setWindowFields
- Backlog
- is related to
-
SERVER-13703 Presence of extraneous $project causes a less efficient plan to be used
- Backlog