Dan Field <dof@llgc.org.uk> writes:
> I have a similar problem with just one of my queries (although it isn't
> a sub select):
You really ought to vacuum and/or analyze occasionally. The EXPLAIN
results show that the planner hasn't got any non-default statistics
for any of these tables.
regards, tom lane