"Steinar H. Gunderson" <sgunderson(at)bigfoot(dot)com> writes:
> It looks like the estimated cost is lower for 8.2.4 -- could it be that the
> fact that he's giving it more memory lead to the planner picking a plan that
> happens to be worse?
Offhand I don't think so. More work_mem might make a hash join look
cheaper (or a sort for a mergejoin), but the problem here seems to be
that it's switching away from a hash and to a nestloop. Which is a
loser because there are many more outer-relation rows than it's
expecting.
regards, tom lane