Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 49c9d9f

Browse files
Unify VACUUM VERBOSE and autovacuum logging.
The log_autovacuum_min_duration instrumentation used its own dedicated code for logging, which was not reused by VACUUM VERBOSE. This was highly duplicative, and sometimes led to each code path using slightly different accounting for essentially the same information. Clean things up by making VACUUM VERBOSE reuse the same instrumentation code. This code restructuring changes the structure of the VACUUM VERBOSE output itself, but that seems like an overall improvement. The most noticeable change in VACUUM VERBOSE output is that it no longer outputs a distinct message per index per round of index vacuuming. Most of the same information (about each index) is now shown in its new per-operation summary message. This is far more legible. A few details are no longer displayed by VACUUM VERBOSE, but that's no real loss in practice, especially in the common case where we don't need multiple index scans/rounds of vacuuming. This super fine-grained information is still available via DEBUG2 messages, which might still be useful in debugging scenarios. VACUUM VERBOSE now shows new instrumentation, which is typically very useful: all of the log_autovacuum_min_duration instrumentation that it missed out on before now. This includes information about WAL overhead, buffers hit/missed/dirtied information, and I/O timing information. VACUUM VERBOSE still retains a few INFO messages of its own. This is limited to output concerning the progress of heap rel truncation, as well as some basic information about parallel workers. These details are still potentially quite useful. They aren't a good fit for the log output, which must summarize the whole operation. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-By: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAH2-WzmW4Me7_qR4X4ka7pxP-jGmn7=Npma_-Z-9Y1eD0MQRLw@mail.gmail.com
1 parent 0c53a66 commit 49c9d9f

File tree

5 files changed

+93
-170
lines changed

5 files changed

+93
-170
lines changed

doc/src/sgml/config.sgml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7614,10 +7614,12 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
76147614
displayed in <link linkend="monitoring-pg-stat-database-view">
76157615
<structname>pg_stat_database</structname></link>, in the output of
76167616
<xref linkend="sql-explain"/> when the <literal>BUFFERS</literal> option
7617-
is used, by autovacuum for auto-vacuums and auto-analyzes, when
7618-
<xref linkend="guc-log-autovacuum-min-duration"/> is set and by
7619-
<xref linkend="pgstatstatements"/>. Only superusers can change this
7620-
setting.
7617+
is used, in the output of <xref linkend="sql-vacuum"/> when
7618+
the <literal>VERBOSE</literal> option is used, by autovacuum
7619+
for auto-vacuums and auto-analyzes, when <xref
7620+
linkend="guc-log-autovacuum-min-duration"/> is set and by
7621+
<xref linkend="pgstatstatements"/>. Only superusers can
7622+
change this setting.
76217623
</para>
76227624
</listitem>
76237625
</varlistentry>

0 commit comments

Comments
 (0)