About the optimizer's choice of sort avoidance
Some SQL statements require that data be ordered, including those with
ORDER BY, GROUP BY, and DISTINCT. MIN() and MAX() aggregates also require
ordering of data.
can sometimes avoid sorting steps for:
can also perform the following optimizations, but they are
not based on cost: