> If I pg_dump that database then create a new database (e.g. "tempdb")
> and upload the dump file (thus making a duplicate) then the same query
> only takes 190ms !!
> Vacuum, vacuum analyse, and vacuum full analyse does not seem to have an
> impact on these times.
Damn, for some reason I didn't read that you had already tried vacuum
full. In that case, I can't explain it except perhaps you aren't
vacuuming properly, or the right thing, or it's a disk cache thing.
Chris