Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Date
Msg-id CAAKRu_aHBvcHHKmNkAzRdJ_7xc-Q-LhanirqcyVuJEWHbYHbuQ@mail.gmail.com
Whole thread
In response to Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers
On Mon, Apr 20, 2026 at 4:28 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
>
> I think we can avoid having relallvisible updated by doing two things:
> 1) moving the analyze test_mode above the create index because the
> create index will scan the table and could set pages all-visible and
> then the analyze may update the statistics
> 2) create the table with autovacuum_enabled = false to avoid vacuum
> and analyze running after any of the other table scans may set some
> pages all-visible

So, I don't love that this test relies on pg_class not having been
updated to reflect relallvisible. But, I don't see a good way around
this. If we need the "bad plan" to be a seq scan, then
pg_class.relallvisible can't be updated. As long as only analyze and
vacuum will update pg_class.relallvisible, we can preserve the desired
behavior by disabling autovacuum/analyze for the table and analyzing
it (to get reltuples/relpages) before any scan that could set the VM
for the pages. So, I've done this and committed it in 85ae8ab0533.

- Melanie



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Exit walsender before confirming remote flush in logical replication
Next
From: SATYANARAYANA NARLAPURAM
Date:
Subject: [PATCH] Allow SJE to recognize GiST-backed temporal primary keys