summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2012-04-28 19:11:13 +0000
committerTom Lane2012-04-28 19:11:13 +0000
commitcdbad241f41362aaf09f913722a541e04e048742 (patch)
tree5c448d2d1fc7217850c0426b115d1eb69a22817f
parent05dd9fb18d6572f1467f995085b1de324d0ad028 (diff)
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.
-rw-r--r--src/backend/postmaster/pgstat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index cc141dc980..ee3ad1060b 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -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
{