Re: VACUUMs and WAL

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: VACUUMs and WAL
Дата
Msg-id 1225187130.7721.5.camel@huvostro
обсуждение исходный текст
Ответ на VACUUMs and WAL  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: VACUUMs and WAL  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On Tue, 2008-10-28 at 08:49 +0000, Simon Riggs wrote:
> Looking at a VACUUM's WAL records makes me think twice about the way we
> issue a VACUUM.
> 
> 1. First we scan the heap, issuing a HEAP2 clean record for every block
> that needs cleaning.

IIRC the first heap pass just collects info and does nothing else. 
Is this just an empty/do-nothing WAL record ?

> 2. Then we scan the index, issuing WAL records as appropriate.
> 
> 3. Then we rescan the heap, issuing a HEAP2 clean record for every
> block.
> 
> I don't see a reason why we would issue 2 WAL records per block for a
> VACUUM, nor why we would prune and remove in two steps, dirtying the
> block each time. 

The first pass should just be collecting info and not dirtying anything.
Could it be side effect of setting some transaction visibility bits on
first visit ? 

In that case It would be good, if we could disable doing that that for
vacuum.

> Seems like we could write approximately half the amount
> of data that we do.
> 
> Surely we can come up with a better plan than that one?

-------------------
Hannu Krosing 

http://www.2ndQuadrant.com
PostgreSQL Scalability Training, Services and Support




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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: VACUUMs and WAL
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: VACUUMs and WAL