mirror of
https://github.com/postgres/postgres.git
synced 2025-08-06 18:42:54 +03:00
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.
This commit is contained in:
@@ -784,8 +784,8 @@ pgstat_send_tabstat(PgStat_MsgTabstat *tsmsg)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Report accumulated xact commit/rollback and I/O timings whenever we send
|
* Report and reset accumulated xact commit/rollback and I/O timings
|
||||||
* a normal tabstat message
|
* whenever we send a normal tabstat message
|
||||||
*/
|
*/
|
||||||
if (OidIsValid(tsmsg->m_databaseid))
|
if (OidIsValid(tsmsg->m_databaseid))
|
||||||
{
|
{
|
||||||
@@ -795,6 +795,8 @@ pgstat_send_tabstat(PgStat_MsgTabstat *tsmsg)
|
|||||||
tsmsg->m_block_time_write = pgStatBlockTimeWrite;
|
tsmsg->m_block_time_write = pgStatBlockTimeWrite;
|
||||||
pgStatXactCommit = 0;
|
pgStatXactCommit = 0;
|
||||||
pgStatXactRollback = 0;
|
pgStatXactRollback = 0;
|
||||||
|
pgStatBlockTimeRead = 0;
|
||||||
|
pgStatBlockTimeWrite = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user