According to the experiments in SERVER-68763, replacing the $setWindowFields+$limit stages with a $group stage with $topN decreased the runtime of the step to calculate the cardinality and frequency for a non-unique shard key index by about 20%.
- is related to
-
SERVER-78147 Should be able to generate covered plan if the only dependency is the index key
- Backlog