Transforms generic DISTINCT plus ORDER BY combinations to
REDUCED plus ORDER BY which typically gives better
performance and memory consumption because engines have to keep less data
in-memory to evaluate it.