1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

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.  320545bfcf and ce5bcc4a9f 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
This commit is contained in:
Michael Paquier
2025-02-17 15:09:51 +09:00
parent 320545bfcf
commit 6a8a7ce476
2 changed files with 6 additions and 4 deletions

View File

@ -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,

View File

@ -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,