Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> FWIW, that plan isn't obviously wrong; if it is broken, most
> likely the reason is that the HashAggregate is incorrectly
> unique-ifying the lower table. (Unfortunately, EXPLAIN doesn't
> show enough about the HashAgg to know what it's doing exactly.)
Yeah, I found myself wishing for an EXPLAIN option that would show
that.
> The cost of the HashAggregate is estimated higher, though, which
> suggests that maybe it's distinct'ing on two columns where the
> bogus plan only does one.
FWIW, I noticed that the actual row counts suggested that, too.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company