Thom Brown wrote: > It's a shame I can't optimise it though as the real case that runs > is with a limit of 4000 which takes a long time to complete. Perhaps you should post the real case. -Kevin -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance