The distinct scan $group optimization currently uses flipDistinctScanDirection to implement correct semantics for $last and $bottom. Since SERVER-92456 adds a sortRequirement field to CanonicalDistinct, we should just flip the sortRequirement when needed and use it consistently everywhere in the planner code.
- depends on
-
SERVER-92456 Multiplan DISTINCT_SCANs
- Closed