summaryrefslogtreecommitdiff
path: root/src/backend/commands/analyze.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-10-15 14:31:12 +0200
committerPeter Eisentraut <peter@eisentraut.org>2025-10-15 14:31:12 +0200
commitdd3ae378301f7e84c18f7a90f183c3cd4165c0da (patch)
tree6de83d42ae4be0d0d1c29ed6255cd48e7809cdbc /src/backend/commands/analyze.c
parent12609fbacb007698ec91101b6464436506518346 (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/analyze.c')
-rw-r--r--src/backend/commands/analyze.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 12b4f3fd36e..c2e216563c6 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -138,7 +138,7 @@ analyze_rel(Oid relid, RangeVar *relation,
* Make sure to generate only logs for ANALYZE in this case.
*/
onerel = vacuum_open_relation(relid, relation, params.options & ~(VACOPT_VACUUM),
- params.log_min_duration >= 0,
+ params.log_analyze_min_duration >= 0,
ShareUpdateExclusiveLock);
/* leave if relation could not be opened or locked */
@@ -310,7 +310,7 @@ do_analyze_rel(Relation onerel, const VacuumParams params,
verbose = (params.options & VACOPT_VERBOSE) != 0;
instrument = (verbose || (AmAutoVacuumWorkerProcess() &&
- params.log_min_duration >= 0));
+ params.log_analyze_min_duration >= 0));
if (inh)
ereport(elevel,
(errmsg("analyzing \"%s.%s\" inheritance tree",
@@ -735,9 +735,9 @@ do_analyze_rel(Relation onerel, const VacuumParams params,
{
TimestampTz endtime = GetCurrentTimestamp();
- if (verbose || params.log_min_duration == 0 ||
+ if (verbose || params.log_analyze_min_duration == 0 ||
TimestampDifferenceExceeds(starttime, endtime,
- params.log_min_duration))
+ params.log_analyze_min_duration))
{
long delay_in_ms;
WalUsage walusage;