Skip to content

Commit 5ab0b6a

Browse files
committed
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 f9a09aa. Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discusssion: https://postgr.es/m/CAOzEurQtZEAfg6P0kU3Wa-f9BWQOi0RzJEMPN56wNTOmJLmfaQ@mail.gmail.com
1 parent d432094 commit 5ab0b6a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

doc/src/sgml/ref/explain.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ ROLLBACK;
241241
<para>
242242
Include information on WAL record generation. Specifically, include the
243243
number of records, number of full page images (fpi), the amount of WAL
244-
generated in bytes and the number of times the WAL buffers became full.
244+
generated in bytes, the amount of full page images generated in bytes,
245+
and the number of times the WAL buffers became full.
245246
In text format, only non-zero values are printed.
246247
This parameter may only be used when <literal>ANALYZE</literal> is also
247248
enabled. It defaults to <literal>FALSE</literal>.

src/backend/commands/explain.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4283,7 +4283,8 @@ show_wal_usage(ExplainState *es, const WalUsage *usage)
42834283
{
42844284
/* Show only positive counter values. */
42854285
if ((usage->wal_records > 0) || (usage->wal_fpi > 0) ||
4286-
(usage->wal_bytes > 0) || (usage->wal_buffers_full > 0))
4286+
(usage->wal_bytes > 0) || (usage->wal_buffers_full > 0) ||
4287+
(usage->wal_fpi_bytes > 0))
42874288
{
42884289
ExplainIndentText(es);
42894290
appendStringInfoString(es->str, "WAL:");
@@ -4297,6 +4298,9 @@ show_wal_usage(ExplainState *es, const WalUsage *usage)
42974298
if (usage->wal_bytes > 0)
42984299
appendStringInfo(es->str, " bytes=%" PRIu64,
42994300
usage->wal_bytes);
4301+
if (usage->wal_fpi_bytes > 0)
4302+
appendStringInfo(es->str, " fpi bytes=%" PRIu64,
4303+
usage->wal_fpi_bytes);
43004304
if (usage->wal_buffers_full > 0)
43014305
appendStringInfo(es->str, " buffers full=%" PRId64,
43024306
usage->wal_buffers_full);
@@ -4311,6 +4315,8 @@ show_wal_usage(ExplainState *es, const WalUsage *usage)
43114315
usage->wal_fpi, es);
43124316
ExplainPropertyUInteger("WAL Bytes", NULL,
43134317
usage->wal_bytes, es);
4318+
ExplainPropertyUInteger("WAL FPI Bytes", NULL,
4319+
usage->wal_fpi_bytes, es);
43144320
ExplainPropertyInteger("WAL Buffers Full", NULL,
43154321
usage->wal_buffers_full, es);
43164322
}

0 commit comments

Comments
 (0)