Re: Is vacuum full lock like old's vacuum's lock?

Поиск
Список
Период
Сортировка
От Gregory Wood
Тема Re: Is vacuum full lock like old's vacuum's lock?
Дата
Msg-id 000d01c1c6e2$48b6e9a0$7889ffcc@comstock.com
обсуждение исходный текст
Ответ на Re: Is vacuum full lock like old's vacuum's lock?  (Francisco Reyes <lists@natserv.com>)
Ответы Re: Is vacuum full lock like old's vacuum's lock?
Список pgsql-general
> > > Do sequential scans go over the entire space, including the space not
in
> > > use? It would be great if there was some kind of optimization that
could
> > > move the empty space towards the end. It would probably be an
expensive
> > > operation, but it may be very helpfull on databases with a big
turnaround.
> >
> > The only difference between doing that and doing a VACUUM FULL would be
that
> > the disk usage would remain the same.
>
> There is one other extremely important difference. VACUUM FULL locks the
> table/database.

But to move around records, you *would* have to lock the table. This could
be an incorrect assumption, but I believe that you would need to aquire an
AccessExclusiveLock to rearrange the contents of the table, and that's the
same lock aquired by VACUUM FULL.

To put it another way, when you delete (or update) the first record in a
particular table, to move that record to the end would require moving *all*
the records up by one. This would destroy the existing MVCC system. You
would essentially be VACUUM FULLing every time you did a DELETE or UPDATE.

Greg


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

Предыдущее
От: Francisco Reyes
Дата:
Сообщение: Re: Is vacuum full lock like old's vacuum's lock?
Следующее
От: Francisco Reyes
Дата:
Сообщение: How to check for successfull inserts