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:
parent
24bf1552f6
commit
0f7acbeddf
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user