Re: Doubt w.r.t vacuum

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Doubt w.r.t vacuum
Дата
Msg-id 8797.1059399881@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Doubt w.r.t vacuum  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Список pgsql-hackers
"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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Warning for undefined cursor
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Some macros for error field codes