Gregory Stark <stark@enterprisedb.com> writes:
> I think "distinct" just doesn't know about hash aggregates yet. That's partly
> an oversight and partly of a "feature" in that it gives a convenient way to
> write a query which avoids them. I think it's also partly that "distinct" is
> trickier to fix because it's the same codepath as "distinct on" which is
> decidedly more complex than a simple "distinct".
It's not an oversight :-(. But the DISTINCT/DISTINCT ON code is old,
crufty, and tightly entwined with ORDER BY processing. It'd be nice to
clean it all up someday, but the effort seems a bit out of proportion
to the reward...
regards, tom lane