From: | Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Write visibility map during CLUSTER/VACUUM FULL |
Date: | 2019-09-01 08:07:31 |
Message-ID: | CAPpHfdtcxUVys6r6JqX2s+5CowXDKMOnfcJoJWHyjWDe=hwHMw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment | Content-Type | Size |
---|---|---|
0001-write-vm-during-cluster-1.patch | application/octet-stream | 8.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Pierre Ducroquet | 2019-09-01 09:04:36 | [Patch] Add a reset_computed_values function in pg_stat_statements |
Previous Message | Alexey Zagarin | 2019-09-01 05:25:41 | Re: row filtering for logical replication |