From 6a8a7ce476bd5f042999a04a0d767b38ea6faec0 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 17 Feb 2025 15:09:51 +0900 Subject: Add information about WAL buffers full to VACUUM/ANALYZE (VERBOSE) This commit adds the information about the number of times WAL buffers have been full to the logs generated by VACUUM/ANALYZE (VERBOSE) and in the logs generated by autovacuum, complementing the existing information stored by WalUsage. This is the last part of the backend code where the value of wal_buffers_full can be reported, similarly to all the other fields of WalUsage. 320545bfcfee and ce5bcc4a9f26 have done the same for EXPLAIN and pgss. Author: Bertrand Drouvot Reviewed-by: Ilia Evdokimov Discussion: https://postgr.es/m/Z6SOha5YFFgvpwQY@ip-10-97-1-34.eu-west-3.compute.internal --- src/backend/access/heap/vacuumlazy.c | 5 +++-- src/backend/commands/analyze.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index a231854b1e6..911f68b413d 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -1125,10 +1125,11 @@ heap_vacuum_rel(Relation rel, VacuumParams *params, (long long) total_blks_read, (long long) total_blks_dirtied); appendStringInfo(&buf, - _("WAL usage: %lld records, %lld full page images, %llu bytes\n"), + _("WAL usage: %lld records, %lld full page images, %llu bytes, %lld buffers full\n"), (long long) walusage.wal_records, (long long) walusage.wal_fpi, - (unsigned long long) walusage.wal_bytes); + (unsigned long long) walusage.wal_bytes, + (long long) walusage.wal_buffers_full); appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0)); ereport(verbose ? INFO : LOG, diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 5931d47fdb9..cd75954951b 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -832,10 +832,11 @@ do_analyze_rel(Relation onerel, VacuumParams *params, (long long) total_blks_read, (long long) total_blks_dirtied); appendStringInfo(&buf, - _("WAL usage: %lld records, %lld full page images, %llu bytes\n"), + _("WAL usage: %lld records, %lld full page images, %llu bytes, %lld buffers full\n"), (long long) walusage.wal_records, (long long) walusage.wal_fpi, - (unsigned long long) walusage.wal_bytes); + (unsigned long long) walusage.wal_bytes, + (long long) walusage.wal_buffers_full); appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0)); ereport(verbose ? INFO : LOG, -- cgit v1.2.3