提交 0f7acbed 编写于 作者: R Robert Haas

Make lazy_vacuum_rel call pg_rusage_init only if needed.

do_analyze_rel already does it this way.

Euler Taveira de Oliveira
上级 24bf1552
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册