Re: Skip unregistered custom kinds on stats load

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Sami Imseih <samimseih(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Skip unregistered custom kinds on stats load
Date: 2025-10-22 14:41:42
Message-ID: aPjtJqz/k/07wg24@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Oct 22, 2025 at 02:51:31PM +0900, Michael Paquier wrote:
>
> A first part here is something that Bertrand Drouvot has been working
> on: being able to rebuild the table stats during WAL replay requires
> us to move the stats to be relfilenode-based, so as the startup could
> know where to recreate some of the numbers lost during crash recovery
> from WAL, giving autovacuum a safety net.

Yeah, I resumed working on it recently and should be able to share a patch
next week (based on what we discussed in [1]).

Next week patch will be the first step i.e replace (i.e get rid) PGSTAT_KIND_RELATION
by a brand new PGSTAT_KIND_RELFILENODE and move all the existing stats that are
currently under the PGSTAT_KIND_RELATION to this new PGSTAT_KIND_RELFILENODE.

It will do this by keeping the pg_stat_all_tables|indexes and pg_statio_all_tables|indexes
on top of the PGSTAT_KIND_RELFILENODE and ensure that a relation rewrite keeps
those stats.

Next step will be that, once done, we could work from there to add new stats (add
writes counters (heap_blks_written and friends) and ensure that some counters
(n_dead_tup and friends) are replicated).

[1]: https://www.postgresql.org/message-id/aN07p71KNFR2HdaD%40ip-10-97-1-34.eu-west-3.compute.internal

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-10-22 14:45:39 Re: Fix lag columns in pg_stat_replication not advancing when replay LSN stalls
Previous Message Tom Lane 2025-10-22 14:40:50 Re: abi-compliance-check failure due to recent changes to pg_{clear,restore}_{attribute,relation}_stats()