Currently we only use DISTINCT_SCAN in a $group for last and first accumulators following a sort. Expand to also use DISTINCT_SCAN for top and bottom accumulators.
- is related to
-
SERVER-90017 Parse firstN/lastN/minN/maxN/topN/bottomN with n = 1 into a corresponding first/last/min/max/top/bottom
- Closed
- related to
-
SERVER-85213 Rewrite $sort+$group with $first/$last to use $top/$bottom
- Backlog