Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr> writes:
> I have 8.4.8 on producion and 8.4.9 on test, could that explain the
> difference in plans chosen?
I'd wonder first if you have the same statistics settings on both.
The big problem here is that the estimation of the join size is bad
(8588 versus 0).
regards, tom lane