Doug Fields <dfields-pg-general(at)pexicom(dot)com> writes:
> Earlier today I deleted about 31 million records from one of our tables
> with a very complex query which required a full table scan. This query took
> quite a few hours to run (in fact, overnight).
> Why? The VACUUM doesn't seem to be vacuuming the two indexes on the table.
Have you got any open transactions hanging about? VACUUM probably
thinks it can't remove the tuples yet because they're still potentially
visible to somebody under MVCC rules.
regards, tom lane