aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-02-17 14:50:33 +0900
committerMichael Paquier <michael@paquier.xyz>2025-02-17 14:50:33 +0900
commit320545bfcfee9c6826d9ae96a880ec82fc03d860 (patch)
tree12af5afbfb2299b3c43d9f659e12198c89801ce6 /src/backend/commands/explain.c
parentce5bcc4a9f26484746f82d23584c8e342cba9b10 (diff)
downloadpostgresql-320545bfcfee9c6826d9ae96a880ec82fc03d860.tar.gz
postgresql-320545bfcfee9c6826d9ae96a880ec82fc03d860.zip
Add information about WAL buffers being full to EXPLAIN (WAL)
This is similar to ce5bcc4a9f26, relying on the addition of wal_buffers_full to WalUsage. This time, the information is added to the output generated by EXPLAIN (WAL). Author: Bertrand Drouvot Reviewed-by: Ilia Evdokimov Discussion: https://postgr.es/m/Z6SOha5YFFgvpwQY@ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r--src/backend/commands/explain.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index c24e66f82e1..dc4bef9ab81 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -4242,7 +4242,7 @@ 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_bytes > 0) || (usage->wal_buffers_full > 0))
{
ExplainIndentText(es);
appendStringInfoString(es->str, "WAL:");
@@ -4256,6 +4256,9 @@ show_wal_usage(ExplainState *es, const WalUsage *usage)
if (usage->wal_bytes > 0)
appendStringInfo(es->str, " bytes=" UINT64_FORMAT,
usage->wal_bytes);
+ if (usage->wal_buffers_full > 0)
+ appendStringInfo(es->str, " buffers full=%lld",
+ (long long) usage->wal_buffers_full);
appendStringInfoChar(es->str, '\n');
}
}
@@ -4267,6 +4270,8 @@ show_wal_usage(ExplainState *es, const WalUsage *usage)
usage->wal_fpi, es);
ExplainPropertyUInteger("WAL Bytes", NULL,
usage->wal_bytes, es);
+ ExplainPropertyInteger("WAL Buffers Full", NULL,
+ usage->wal_buffers_full, es);
}
}