Ole Tange <postgresql.org@tange.dk> writes:
> Now I am curious: Why isn't DISTINCT implemented using a Hash aggregate?
Partly lack of round tuits, partly the fact that it is closely
intertwined with ORDER BY and I'm not sure what side-effects would
arise from separating them. In particular, the DISTINCT ON special
case stops making any sense at all if it's not tied to a sort/uniq
underlying implementation.
regards, tom lane