"Jens Reufsteck" <jens(dot)reufsteck(at)staufenbiel(dot)de> writes:
> Ive got a lengthy query, that doesn't finish in reasonable time (i.e.
> 10min+). I suspect, that the query optimizer miscalculates the number of
> rows for part of the query.
> ...
> We're using postgres 9.0.4.
Try 9.0.5. There was a bug fixed in this area.
regards, tom lane