Write visibility map during CLUSTER/VACUUM FULL

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Write visibility map during CLUSTER/VACUUM FULL
Дата
Msg-id CAPpHfdtcxUVys6r6JqX2s+5CowXDKMOnfcJoJWHyjWDe=hwHMw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Write visibility map during CLUSTER/VACUUM FULL  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: Write visibility map during CLUSTER/VACUUM FULL  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Hi!

I found it weird that CLUSTER/VACUUM FULL don't write visibility map.
Attached patch implements writing visibility map in
heapam_relation_copy_for_cluster().

I've studied previous attempt to implement this [1].  The main problem
of that attempt was usage of existing heap_page_is_all_visible() and
visibilitymap_set() functions.  These functions works through buffer
manager, while heap rewriting is made bypass buffer manager.

In my patch visibility map pages are handled in the same way as heap
pages are.  RewriteStateData holds contents of single VM page.  Once
heap page is finished, corresponding bits are set to VM page etc.  VM
pages are flushed one-by-one to smgr.

This patch have to implement its own check if tuple is allvisible.
But it appears to be possible to simplify this check assuming that all
tuples already past HeapTupleSatisfiesVacuum(), which sets hint bits.

Links
1. https://www.postgresql.org/message-id/flat/20131203162556.GC27105%40momjian.us#90e4a6e77d92076650dcf1d96b32ba38

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Вложения

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

Предыдущее
От: Alexey Zagarin
Дата:
Сообщение: Re: row filtering for logical replication
Следующее
От: Pierre Ducroquet
Дата:
Сообщение: [Patch] Add a reset_computed_values function in pg_stat_statements