Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb77752

Browse files
Add WAL usage reporting to ANALYZE VERBOSE output.
This change adds WAL usage reporting to the output of ANALYZE VERBOSEand autoanalyze reports. It aligns the analyze output with VACUUM,providing consistency. Additionally, it aids in troubleshooting caseswhere WAL records are generated during analyze operations.Author: Anthonin BonnefoyReviewed-by: Masahiko SawadaDiscussion:https://postgr.es/m/CAO6_Xqr__kTTCLkftqS0qSCm-J7_xbRG3Ge2rWhucxQJMJhcRA%40mail.gmail.com
1 parentde239d0 commitbb77752

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/backend/commands/analyze.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
305305
Oidsave_userid;
306306
intsave_sec_context;
307307
intsave_nestlevel;
308+
WalUsagestartwalusage=pgWalUsage;
308309
BufferUsagestartbufferusage=pgBufferUsage;
309310
BufferUsagebufferusage;
310311
PgStat_Counterstartreadtime=0;
@@ -740,6 +741,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
740741
params->log_min_duration))
741742
{
742743
longdelay_in_ms;
744+
WalUsagewalusage;
743745
doubleread_rate=0;
744746
doublewrite_rate=0;
745747
char*msgfmt;
@@ -750,6 +752,8 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
750752

751753
memset(&bufferusage,0,sizeof(BufferUsage));
752754
BufferUsageAccumDiff(&bufferusage,&pgBufferUsage,&startbufferusage);
755+
memset(&walusage,0,sizeof(WalUsage));
756+
WalUsageAccumDiff(&walusage,&pgWalUsage,&startwalusage);
753757

754758
total_blks_hit=bufferusage.shared_blks_hit+
755759
bufferusage.local_blks_hit;
@@ -818,6 +822,11 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
818822
(long long)total_blks_hit,
819823
(long long)total_blks_read,
820824
(long long)total_blks_dirtied);
825+
appendStringInfo(&buf,
826+
_("WAL usage: %lld records, %lld full page images, %llu bytes\n"),
827+
(long long)walusage.wal_records,
828+
(long long)walusage.wal_fpi,
829+
(unsigned long long)walusage.wal_bytes);
821830
appendStringInfo(&buf,_("system usage: %s"),pg_rusage_show(&ru0));
822831

823832
ereport(verbose ?INFO :LOG,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp