Re: Disabling Heap-Only Tuples

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: James Locke <james.locke.uk@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, Laurenz Albe <laurenz.albe@cybertec.at>, Andres Freund <andres@anarazel.de>, Thomas Munro <thomas.munro@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Thom Brown <thom@linux.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-05-08T13:00:06Z
Lists: pgsql-hackers
Hello James,

On 2026-May-08, James Locke wrote:

> Attached is a POC to enable userland table compaction: A top-level COMPACT
> command that performs the relocation directly in the server, with a
> stripped-down heap_relocate primitive instead of full UPDATE, and a
> built-in prune-and-truncate pass so it runs to a useful end state in one
> command.

How does this implementation handle the case of a seqscan in the middle
of scanning the table, which has already skipped the destination page
and not yet the page from where the table is to be removed?  There needs
to be a way to distinguish which of these to show (it must be exactly
one), and you didn't mention this in your description.

Thanks

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/