Re: Add pg_walinspect function with block info columns - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Add pg_walinspect function with block info columns
Date
Msg-id CALj2ACWaZJptqQ=tX0tyi8Mj3_Hxd5FxA=LMOAdS=x4EAA+enw@mail.gmail.com
Whole thread Raw
In response to Re: Add pg_walinspect function with block info columns  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: Add pg_walinspect function with block info columns  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Mar 15, 2023 at 7:20 AM Peter Geoghegan <pg@bowt.ie> wrote:
>
> > But, perhaps you are suggesting a parameter to pg_get_wal_records_info()
> > like "with_block_info" or something, which produces the full
> > denormalized block + record output?
>
> I was thinking of something like that, yes -- though it wouldn't
> necessarily have to be the *full* denormalized block_ref info, the FPI
> itself, etc. Just the more useful stuff.
>
> It occurs to me that my concern about the information that
> pg_get_wal_records_info() lacks could be restated as a concern about
> what pg_get_wal_block_info() lacks: pg_get_wal_block_info() fails to
> show basic information about the WAL record whose blocks it reports
> on, even though it could easily show all of the
> pg_get_wal_records_info() info once per block (barring block_ref). So
> addressing my concern by adjusting pg_get_wal_block_info() might be
> the best approach. I'd probably be happy with that -- I'd likely just
> stop using pg_get_wal_records_info() completely under this scheme.

How about something like the attached? It adds the per-record columns
to pg_get_wal_block_info() avoiding "possibly expensive" joins with
pg_get_wal_records_info().

With this, pg_get_wal_records_info() too will be useful for users
scanning WAL at record level. That is to say that we can retain both
pg_get_wal_records_info() and pg_get_wal_block_info().

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

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Allow logical replication to copy tables in binary format
Next
From: Jeff Davis
Date:
Subject: Re: ICU locale validation / canonicalization