>>The only other job that could be running is a vacuum I run at 1am but I
don't think it would take an hour to run.
Famous last words... :-) It should be easy to check this, but I don't know
if that is a likely source of problems anyway.
If I were you I'd just do VACUUM ANALYSE in one comand. It would certainly
eliminate that as a factor.
At this stage you have no idea which table it occurs on, or if it always
happens on the same table, or at the same time, am I right? Failing any more
useful response from those with more internal knowledge you may have to
resort to collecting information and trying to isolate the problem.
It would be a good idea to give all the relevant version numbers too
regards
iain