Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently
Дата
Msg-id CAGTBQpZFzGcGd_9W+xQgeU6T3XCu-sS-Xj0OPUPW9ZpJmRViSw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently  (Claudio Freire <klaussfreire@gmail.com>)
Список pgsql-hackers
On Mon, Feb 26, 2018 at 11:31 AM, Claudio Freire <klaussfreire@gmail.com> wrote:
>> ----
>> +               /*
>> +                * If there are no indexes then we should periodically
>> vacuum the FSM
>> +                * on huge relations to make free space visible early.
>> +                */
>> +               if (nindexes == 0 &&
>> +                       (vacuumed_pages - vacuumed_pages_at_fsm_vac) >
>> vacuum_fsm_every_pages)
>> +               {
>> +                       /* Vacuum the Free Space Map */
>> +                       FreeSpaceMapVacuum(onerel, max_freespace);
>> +                       vacuumed_pages_at_fsm_vac = vacuumed_pages;
>> +                       max_freespace = 0;
>> +               }
>>
>> I think this code block should be executed before we check if the page
>> is whether new or empty and then do 'continue'. Otherwise we cannot
>> reach this code if the table has a lot of new or empty pages.
>
> In order for the counter (vacuumed_pages) to increase, there have to
> be plenty of opportunities for this code to run, and I specifically
> wanted to avoid vacuuming the FSM too often for those cases
> particularly (when Vacuum scans lots of pages but does no writes).

Wait, I see what you mean. Entirely empty pages.

Ok, I can move it.


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Partition-wise aggregation/grouping
Следующее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: Contention preventing locking