"Shridhar Daithankar" <shridhar_daithankar@persistent.co.in> writes:
> 1. IIRC vacuum recovers/reuses dead tuples generated from update but can not do
> so for delete? Why?
This is not correct.
> 2. Vacuum full locks entire table, is it possible that it locks a page at a
> time and deal with it.
No. You can't compact the table by moving tuples without locking the
entire table. (For example, if we move a tuple from the end down to an
earlier page, it's quite possible that a concurrently executing
sequential scan would miss that tuple entirely. Another problem is that
we cannot truncate the table to fewer pages without locking out writers;
else we may decide that there are N empty pages, then execute ftruncate()
just after someone has put a new tuple into one of those pages.)
Non-full vacuum is designed specifically to do what can be done without
an exclusive lock.
regards, tom lane