•DISTINCT
is more often wrong than right, frequently (imperfectly!)
patching a deeper, underlying problem.
•DISTINCT
is not the only way to get a bad sort-unique step, though!
•UNION
can trigger an incorrect sort-unique step: remember that it does not just
discard duplicates in different SELECT
blocks!.
•GROUP
BY can trigger an incorrect sort-unique step,
too.