vac_rusage.diff

text/x-patch

Filename: vac_rusage.diff
Type: text/x-patch
Part: 0
Message: vacuum rusage fix
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index c5bf32e..b5547c5 100644
*** a/src/backend/commands/vacuumlazy.c
--- b/src/backend/commands/vacuumlazy.c
*************** lazy_vacuum_rel(Relation onerel, VacuumS
*** 155,165 ****
  	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 (vacstmt->options & VACOPT_VERBOSE)
  		elevel = INFO;
--- 155,167 ----
  	bool		scan_all;
  	TransactionId freezeTableLimit;
  
  	/* measure elapsed time iff autovacuum logging requires it */
! 	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;