Previously extra clauses where unconditionally appended to ordering_aliases (the stuff that ends up in the select) - but that isn't necessary, we can skip the append if this isn't plain distinct query.