Re: [HACKERS] Re: vacuum timings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Re: vacuum timings
Дата
Msg-id 9694.948492126@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: vacuum timings  (The Hermit Hacker <scrappy@hub.org>)
Ответы Re: [HACKERS] Re: vacuum timings  (The Hermit Hacker <scrappy@hub.org>)
Список pgsql-hackers
The Hermit Hacker <scrappy@hub.org> writes:
>> lock table for less duration, or read lock

> if there is some way that we can work around the bug that I believe Tom
> found with removing the lock altogether (ie. makig use of MVCC), I think
> that would be the best option ... if not possible, at least get things
> down to a table lock vs the whole database?

Huh?  VACUUM only requires an exclusive lock on the table it is
currently vacuuming; there's no database-wide lock.

Even a single-table exclusive lock is bad, of course, if it's a large
table that's critical to a 24x7 application.  Bruce was talking about
the possibility of having VACUUM get just a write lock on the table;
other backends could still read it, but not write it, during the vacuum
process.  That'd be a considerable step forward for 24x7 applications,
I think.

It looks like that could be done if we rewrote the table as a new file
(instead of compacting-in-place), but there's a problem when it comes
time to rename the new files into place.  At that point you'd need to
get an exclusive lock to ensure all the readers are out of the table too
--- and upgrading from a plain lock to an exclusive lock is a well-known
recipe for deadlocks.  Not sure if this can be solved.
        regards, tom lane


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

Предыдущее
От: Alfred Perlstein
Дата:
Сообщение: Re: [HACKERS] pg_dump disaster
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] pg_dump disaster