Re: Vacuuming

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Vacuuming
Дата
Msg-id 21713.1178591249@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Vacuuming  (Paul Lambert <paul.lambert@autoledgers.com.au>)
Ответы Re: Vacuuming  (Paul Lambert <paul.lambert@autoledgers.com.au>)
Re: Vacuuming  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Paul Lambert <paul.lambert@autoledgers.com.au> writes:
> Is there any point to vacuuming a table if it has been bulk-populated by
> data after a truncate?

> I.e. If I do this:
> TRUNCATE TABLE vehicles;
> INSERT INTO vehicles (SELECT DISTINCT ON (dealer_id,vehicle_address) *
> FROM vehicles_temp_load WHERE (dealer_id,vehicle_address) is not null);

> Is there any point in vacuuming?

The only thing a vacuum would do for you there is set the commit hint
bits on the newly-inserted rows.  Which might be worth doing if you want
to get the table into a totally "clean" state, but it's probably a bit
excessive.  SELECTs on the table will set the hint bits anyway as
they visit not-yet-hinted rows, so it's really a matter of do you want
to pay that overhead all at once or spread-out.

What you *do* want to do in this situation is an ANALYZE.

            regards, tom lane

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

Предыдущее
От: Paul Lambert
Дата:
Сообщение: Vacuuming
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Date Math