Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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).
But both servers develop that estimate for the join size. I was
wondering more about whether the costing factors were really the
same:
slow:
-> Nested Loop
(cost=0.00..792824.51 rows=8588 width=275)
(actual time=3269.997..3269.997 rows=0 loops=1)
versus fast:
-> Hash Join
(cost=857.00..31152.80 rows=8588 width=275)
(actual time=37.968..37.968 rows=0 loops=1)
The hash join path must look more expensive on the first machine,
for some reason.
Mario, could you post the result of running this query from both
servers?:
http://wiki.postgresql.org/wiki/Server_Configuration
-Kevin