Just tested on 9.0.5, seems ok. Explain for the suspected sub query is now in line with Analyze. Thanks Jens "Jens Reufsteck" <jens.reufsteck@xxxxxxxxxxxxxx> writes: > I’ve 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 -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance