diff options
| author | Michael Paquier <michael@paquier.xyz> | 2025-10-30 15:34:01 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2025-10-30 15:34:01 +0900 |
| commit | 5ab0b6a248076bf373a80bc7e83a5dfa4edf13aa (patch) | |
| tree | 649f999a55443fed31e67568d61ada4a2d48238b /src/backend | |
| parent | d432094689062b6a0b7b2504b289d34defca8888 (diff) | |
Expose wal_fpi_bytes in EXPLAIN (WAL)
The new wal_fpi_bytes counter calculates the total amount of full page
images inserted in WAL records, in bytes. This commit exposes this
information in EXPLAIN (ANALYZE, WAL) alongside the existing counters,
for both the text and JSON/YAML outputs, building upon f9a09aa29520.
Author: Shinya Kato <shinya11.kato@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discusssion: https://postgr.es/m/CAOzEurQtZEAfg6P0kU3Wa-f9BWQOi0RzJEMPN56wNTOmJLmfaQ@mail.gmail.com
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/commands/explain.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index e6edae0845c..7e699f8595e 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -4283,7 +4283,8 @@ show_wal_usage(ExplainState *es, const WalUsage *usage) { /* Show only positive counter values. */ if ((usage->wal_records > 0) || (usage->wal_fpi > 0) || - (usage->wal_bytes > 0) || (usage->wal_buffers_full > 0)) + (usage->wal_bytes > 0) || (usage->wal_buffers_full > 0) || + (usage->wal_fpi_bytes > 0)) { ExplainIndentText(es); appendStringInfoString(es->str, "WAL:"); @@ -4297,6 +4298,9 @@ show_wal_usage(ExplainState *es, const WalUsage *usage) if (usage->wal_bytes > 0) appendStringInfo(es->str, " bytes=%" PRIu64, usage->wal_bytes); + if (usage->wal_fpi_bytes > 0) + appendStringInfo(es->str, " fpi bytes=%" PRIu64, + usage->wal_fpi_bytes); if (usage->wal_buffers_full > 0) appendStringInfo(es->str, " buffers full=%" PRId64, usage->wal_buffers_full); @@ -4311,6 +4315,8 @@ show_wal_usage(ExplainState *es, const WalUsage *usage) usage->wal_fpi, es); ExplainPropertyUInteger("WAL Bytes", NULL, usage->wal_bytes, es); + ExplainPropertyUInteger("WAL FPI Bytes", NULL, + usage->wal_fpi_bytes, es); ExplainPropertyInteger("WAL Buffers Full", NULL, usage->wal_buffers_full, es); } |
