Fredrik Olsson <fredrik.olsson@xxxxxxxxx> writes: > I have some quite huge queries, inside functions, so debugging is kind > of hard. But I have located the query that for some reason gets 4 times > as slow after an analyze. Could we see EXPLAIN ANALYZE output for these cases, not just EXPLAIN? It seems a bit premature to be discussing ways to "force" a plan choice when you don't even have a clear idea what's going wrong. regards, tom lane