Greg Stark <gsstark@mit.edu> writes:
> Incidentally, "HashAggregate"?! Based on the earlier discussion on this I
> would have expected that line to read "Materialize"
It's using a grouped aggregation node to implement a UNIQUE filter, so
that it can replace the "WHERE foo IN (subselect)" by a straight join.
Of course in this case the uniqueness filter is a waste of time, but
in general the planner can't be expected to know that.
regards, tom lane