Skip to content

Commit 6a8a7ce

Browse files
committed
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. 320545b and ce5bcc4 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
1 parent 320545b commit 6a8a7ce

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,10 +1125,11 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
11251125
(long long) total_blks_read,
11261126
(long long) total_blks_dirtied);
11271127
appendStringInfo(&buf,
1128-
_("WAL usage: %lld records, %lld full page images, %llu bytes\n"),
1128+
_("WAL usage: %lld records, %lld full page images, %llu bytes, %lld buffers full\n"),
11291129
(long long) walusage.wal_records,
11301130
(long long) walusage.wal_fpi,
1131-
(unsigned long long) walusage.wal_bytes);
1131+
(unsigned long long) walusage.wal_bytes,
1132+
(long long) walusage.wal_buffers_full);
11321133
appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0));
11331134

11341135
ereport(verbose ? INFO : LOG,

src/backend/commands/analyze.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,11 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
832832
(long long) total_blks_read,
833833
(long long) total_blks_dirtied);
834834
appendStringInfo(&buf,
835-
_("WAL usage: %lld records, %lld full page images, %llu bytes\n"),
835+
_("WAL usage: %lld records, %lld full page images, %llu bytes, %lld buffers full\n"),
836836
(long long) walusage.wal_records,
837837
(long long) walusage.wal_fpi,
838-
(unsigned long long) walusage.wal_bytes);
838+
(unsigned long long) walusage.wal_bytes,
839+
(long long) walusage.wal_buffers_full);
839840
appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0));
840841

841842
ereport(verbose ? INFO : LOG,

0 commit comments

Comments
 (0)