Commit cdbad241 authored by Tom Lane's avatar Tom Lane

Clear I/O timing counters after sending them to the stats collector.

This oversight caused the reported times to accumulate in an O(N^2)
fashion the longer a backend runs.
parent 05dd9fb1
......@@ -784,8 +784,8 @@ pgstat_send_tabstat(PgStat_MsgTabstat *tsmsg)
return;
/*
* Report accumulated xact commit/rollback and I/O timings whenever we send
* a normal tabstat message
* Report and reset accumulated xact commit/rollback and I/O timings
* whenever we send a normal tabstat message
*/
if (OidIsValid(tsmsg->m_databaseid))
{
......@@ -795,6 +795,8 @@ pgstat_send_tabstat(PgStat_MsgTabstat *tsmsg)
tsmsg->m_block_time_write = pgStatBlockTimeWrite;
pgStatXactCommit = 0;
pgStatXactRollback = 0;
pgStatBlockTimeRead = 0;
pgStatBlockTimeWrite = 0;
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment