Tom McLoughlin <tom@xxxxxxxxxxxxxxxxxxx> wrote: > Thank you very much for your help. > > It's difficult for me to run analyse explain for the query given because it > takes so long. However, the query below has a similar structure but has less > data to process. Seems okay, but it's better to analyse that for the real query. You can install the auto_explain - module and enable auto_explain.log_analyze and set auto_explain.log_min_duration to a proper value. You can find later the explain analse - ouput in the log. Consider all steps mit seq-scans, but as i see all seq-scan are on small tables and the majority of rows are in the result, so an index can't help much. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknown) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889° -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance