Jakub Ouhrabka <kuba(at)comgate(dot)cz> writes:
> I tried to simplify the query even more and now I have query which on
> 8.2.4 is planned instantly and on 8.2.5 takes cca 8 seconds.
Are you sure you were using the same planner parameters (particularly
join_collapse_limit and the geqo threshold) in both cases?
regards, tom lane