Re: Why doesn't Vacuum FULL update the VM

Поиск
Список
Период
Сортировка
От Melanie Plageman
Тема Re: Why doesn't Vacuum FULL update the VM
Дата
Msg-id CAAKRu_YrLE6m5zCj8niukKdtwhbk0U2yORDbevavjcWgN21OQg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why doesn't Vacuum FULL update the VM  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On Fri, Sep 1, 2023 at 8:38 PM Peter Geoghegan <pg@bowt.ie> wrote:
>
> On Fri, Sep 1, 2023 at 12:34 PM Melanie Plageman
> <melanieplageman@gmail.com> wrote:
> > I don't see why the visibility map shouldn't be updated so that all of
> > the pages show all visible and all frozen for this relation after the
> > vacuum full.
>
> There was a similar issue with COPY FREEZE. It was fixed relatively
> recently -- see commit 7db0cd21.

Thanks for digging that up for me!

My first thought after looking a bit at the vacuum full/cluster code
is that we could add an all_visible flag to the RewriteState and set
it to false in heapam_relation_copy_for_cluster() in roughly the same
cases as heap_page_is_all_visible(), then, if rwstate->all_visible is
true in raw_heap_insert(), when we need to advance to the next block,
we set the page all visible and update the VM. Either way, we reset
all_visible to true since we are advancing to the next block.

I wrote a rough outline of that idea in the attached patches. It
doesn't emit WAL for the VM update or handle toast tables or anything
(it is just a rough sketch), but I just wondered if this was in the
right direction.

- Melanie

Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: psql: show current user in prompt
Следующее
От: jian he
Дата:
Сообщение: Re: Cleaning up array_in()