Hi,
Finally found the problem.
Turning off nested loops gave me much better performance on 8.3 than 8.1.
The problem seems to come from postgresql miscalculation of the number
of rows returned by nested loops.
It is well described in that thread:
Hi guys,
I've got a query that is running slower on 8.3 than on 8.1 (with
equivalent server config),
because the join ordering is not the same, at least that's my guess... ;-)
In 8.1.4, table A had 122880 pages, B 112690 pages and C 80600 pages.
Now in 8.3.3, table A has only 77560 pages, B
Patrick Vachon wrote:
Hi guys,
I've got a query that is running slower on 8.3 than on 8.1 (with
equivalent server config),
because the join ordering is not the same, at least that's my guess... ;-)
In 8.1.4, table A had 122880 pages, B 112690 pages and C 80600 pages.
Now in 8.3.3,