Re: Alternative for vacuuming queue-like tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Alternative for vacuuming queue-like tables
Дата
Msg-id 1217.1146238121@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Alternative for vacuuming queue-like tables  (Csaba Nagy <nagy@ecircle-ag.com>)
Ответы Re: Alternative for vacuuming queue-like tables  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-general
Csaba Nagy <nagy@ecircle-ag.com> writes:
> I'm not sure how this operation can work in the presence of other long
> running transactions which did not touch the queue table yet, but it
> actually does work, I can confirm that. Is it violating MVCC maybe ?

Yes :-(.  I think you can get away with it if all your transactions that
use the queue table run in READ COMMITTED (not serializable) mode, and
if they work like

    BEGIN;
    LOCK queue_table IN some-suitable-mode;
    process queue table;
    COMMIT;

Grabbing the lock will ensure that CLUSTER finishes before any snapshot
is taken.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to define + operator for strings
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: Alternative for vacuuming queue-like tables