Gary Stainburn <gary.stainburn@ringways.co.uk> writes:
> Anyone got any ideas of the cause, or thoughts on how I can trace the
> problem?
EXPLAIN ANALYZE results for the fast and slow cases would be
interesting. Also, have you ANALYZEd the underlying tables lately?
And what PG version is this?
regards, tom lane