-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query Optimization
At the moment, we execute the following pipeline:
{$sort: {a: 1}} {$group: {_id: "$b"}}
Despite the fact that the $sort has no effect upon the $group.
We should change DocumentSourceSort::optimizeAt() to remove itself if the following stage is a $group that doesn't use any of the sort's keys.
- is related to
-
SERVER-28980 aggregation can subsume $sort into $group when $first/$last are present
- Backlog
-
SERVER-9507 Optimize $sort+$group+$first pipeline to avoid full index scan
- Closed
- related to
-
SERVER-18287 Restore the "impossible match" heuristic present in the 2.4 query engine (no longer present as of 2.6)
- Closed