diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2025-10-15 14:31:12 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2025-10-15 14:31:12 +0200 |
| commit | dd3ae378301f7e84c18f7a90f183c3cd4165c0da (patch) | |
| tree | 6de83d42ae4be0d0d1c29ed6255cd48e7809cdbc /src/backend/commands/vacuum.c | |
| parent | 12609fbacb007698ec91101b6464436506518346 (diff) | |
Add log_autoanalyze_min_duration
The log output functionality of log_autovacuum_min_duration applies to
both VACUUM and ANALYZE, so it is not possible to separate the VACUUM
and ANALYZE log output thresholds. Logs are likely to be output only for
VACUUM and not for ANALYZE.
Therefore, we decided to separate the threshold for log output of VACUUM
by autovacuum (log_autovacuum_min_duration) and the threshold for log
output of ANALYZE by autovacuum (log_autoanalyze_min_duration).
Author: Shinya Kato <shinya11.kato@gmail.com>
Reviewed-by: Kasahara Tatsuhito <kasaharatt@oss.nttdata.com>
Discussion: https://www.postgresql.org/message-id/flat/CAOzEurQtfV4MxJiWT-XDnimEeZAY+rgzVSLe8YsyEKhZcajzSA@mail.gmail.com
Diffstat (limited to 'src/backend/commands/vacuum.c')
| -rw-r--r-- | src/backend/commands/vacuum.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index e2f181eed7b..ed03e3bd50d 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -406,8 +406,12 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) /* user-invoked vacuum is never "for wraparound" */ params.is_wraparound = false; - /* user-invoked vacuum uses VACOPT_VERBOSE instead of log_min_duration */ - params.log_min_duration = -1; + /* + * user-invoked vacuum uses VACOPT_VERBOSE instead of + * log_vacuum_min_duration and log_analyze_min_duration + */ + params.log_vacuum_min_duration = -1; + params.log_analyze_min_duration = -1; /* * Later, in vacuum_rel(), we check if a reloption override was specified. @@ -2063,7 +2067,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams params, /* open the relation and get the appropriate lock on it */ rel = vacuum_open_relation(relid, relation, params.options, - params.log_min_duration >= 0, lmode); + params.log_vacuum_min_duration >= 0, lmode); /* leave if relation could not be opened or locked */ if (!rel) |
