aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/vacuumlazy.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index c5bf32e00fa..b5547c5e757 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -155,11 +155,13 @@ lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt,
bool scan_all;
TransactionId freezeTableLimit;
- pg_rusage_init(&ru0);
-
/* measure elapsed time iff autovacuum logging requires it */
- if (IsAutoVacuumWorkerProcess() && Log_autovacuum_min_duration > 0)
- starttime = GetCurrentTimestamp();
+ if (IsAutoVacuumWorkerProcess() && Log_autovacuum_min_duration >= 0)
+ {
+ pg_rusage_init(&ru0);
+ if (Log_autovacuum_min_duration > 0)
+ starttime = GetCurrentTimestamp();
+ }
if (vacstmt->options & VACOPT_VERBOSE)
elevel = INFO;