"Eric Brown" <bigwhitecow(at)hotmail(dot)com> writes:
> Here's the query as I have changed it now:
Now that you've switched to JOIN syntax, you can cut the planning time
to nil by setting join_collapse_limit to 1. See
http://www.postgresql.org/docs/7.4/static/explicit-joins.html
regards, tom lane