Re: Add pg_walinspect function with block info columns
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Michael Paquier <michael@paquier.xyz>,
Melanie Plageman <melanieplageman@gmail.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2023-03-18T04:38:53Z
Lists: pgsql-hackers
Attachments
- v3-0001-Few-optimizations-around-block-references-in-pg_w.patch (application/x-patch) patch v3-0001
- v3-0002-Emit-WAL-record-info-via-pg_get_wal_block_info.patch (application/x-patch) patch v3-0002
On Sat, Mar 18, 2023 at 1:06 AM Peter Geoghegan <pg@bowt.ie> wrote: > > On Fri, Mar 17, 2023 at 12:20 AM Bharath Rupireddy > <bharath.rupireddyforpostgres@gmail.com> wrote: > > +1 for pg_get_wal_block_info emitting per-record WAL info too along > > with block info, attached v2 patch does that. IMO, usability wins the > > race here. > > I think that this direction makes a lot of sense. Under this scheme, > we still have pg_get_wal_records_info(), which is more or less an SQL > interface to the information that pg_waldump presents by default. > That's important when the record view of things is of primary > importance. But now you also have a "block oriented" view of WAL > presented by pg_get_wal_block_info(), which is useful when particular > blocks are of primary interest. I think that I'll probably end up > using both, while primarily using pg_get_wal_block_info() for more > advanced analysis that focuses on what happened to particular blocks > over time. Hm. > It makes sense to present pg_get_wal_block_info() immediately after > pg_get_wal_records_info() in the documentation under this scheme, > since they're closely related. -1. I don't think we need that and even if we did, it's hard to maintain that ordering in future. One who knows to use these functions will anyway get to know how they're related. > (Checks pg_walinspect once more...) > > Actually, I now see that block_ref won't be NULL for those records > that have no block references at all -- it just outputs an empty > string. Yes, that's unnecessary. > But wouldn't it be better if it actually output NULL? +1 done so in the attached 0001 patch. > Better > for its own sake, but also better because doing so enables describing > the relationship between the two functions with reference to > block_ref. It seems particularly helpful to me to be able to say that > pg_get_wal_block_info() doesn't show anything for precisely those WAL > records whose block_ref is NULL according to > pg_get_wal_records_info(). Hm. Attaching v3 patch set - 0001 optimizations around block references, 0002 enables pg_get_wal_block_info() to emit per-record info. Any thoughts? -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
Add show_data option to pg_get_wal_block_info.
- df4f3ab51730 16.0 landed
-
Show record information in pg_get_wal_block_info.
- 122376f028a0 16.0 landed
-
Fix recent pg_walinspect fpi_length bug.
- bade01cb4dd8 16.0 landed
-
Improve a few things in pg_walinspect
- 0276ae42ddea 16.0 landed
-
Rework design of functions in pg_walinspect
- 5c1b6628075a 16.0 cited
-
pg_walinspect: pg_get_wal_fpi_info() -> pg_get_wal_block_info()
- 9ecb134a93f0 16.0 landed