Add wal_fpi_bytes to VACUUM and ANALYZE logs
authorMichael Paquier <[email protected]>
Mon, 3 Nov 2025 10:42:03 +0000 (19:42 +0900)
committerMichael Paquier <[email protected]>
Mon, 3 Nov 2025 10:42:03 +0000 (19:42 +0900)
The new wal_fpi_bytes counter calculates the total amount of full page
images inserted in WAL records, in bytes.  This commit adds this
information to VACUUM and ANALYZE logs alongside the existing counters,
building upon f9a09aa29520.

Author: Shinya Kato <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/[email protected]

src/backend/access/heap/vacuumlazy.c
src/backend/commands/analyze.c

index d2b031fdd06ba2feea04c39e6a85aa8ec5d832ab..61fe623cc6084144d14dd85df7e1ff1bb8d3b647 100644 (file)
@@ -1148,10 +1148,11 @@ heap_vacuum_rel(Relation rel, const VacuumParams params,
                             total_blks_read,
                             total_blks_dirtied);
            appendStringInfo(&buf,
-                            _("WAL usage: %" PRId64 " records, %" PRId64 " full page images, %" PRIu64 " bytes, %" PRId64 " buffers full\n"),
+                            _("WAL usage: %" PRId64 " records, %" PRId64 " full page images, %" PRIu64 " bytes, %" PRIu64 " full page image bytes, %" PRId64 " buffers full\n"),
                             walusage.wal_records,
                             walusage.wal_fpi,
                             walusage.wal_bytes,
+                            walusage.wal_fpi_bytes,
                             walusage.wal_buffers_full);
            appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0));
 
index c2e216563c63c1e0cd5385c3398d06c33e2be65e..25089fae3e006686db255f5d953d78c8d4e00bb5 100644 (file)
@@ -831,10 +831,11 @@ do_analyze_rel(Relation onerel, const VacuumParams params,
                             total_blks_read,
                             total_blks_dirtied);
            appendStringInfo(&buf,
-                            _("WAL usage: %" PRId64 " records, %" PRId64 " full page images, %" PRIu64 " bytes, %" PRId64 " buffers full\n"),
+                            _("WAL usage: %" PRId64 " records, %" PRId64 " full page images, %" PRIu64 " bytes, %" PRIu64 " full page image bytes, %" PRId64 " buffers full\n"),
                             walusage.wal_records,
                             walusage.wal_fpi,
                             walusage.wal_bytes,
+                            walusage.wal_fpi_bytes,
                             walusage.wal_buffers_full);
            appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0));