mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
Make lazy_vacuum_rel call pg_rusage_init only if needed.
do_analyze_rel already does it this way. Euler Taveira de Oliveira
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user