summaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorBruce Momjian2006-04-27 00:06:59 +0000
committerBruce Momjian2006-04-27 00:06:59 +0000
commit944a17bf9f7f8394b693b12a5861576964cad97b (patch)
tree157441901761ab5b6b087495db2f765592f2cb3f /src/include/pgstat.h
parenta1e5331b0745438efce46b3c9e1649a81d57796e (diff)
Delay write of pg_stats file to once every five minutes, during
shutdown, or when requested by a backend: It changes so the file is only written once every 5 minutes (changeable of course, I just picked something) instead of once every half second. It's still written when the stats collector shuts down, just as before. And it is now also written on backend request. A backend requests a rewrite by simply sending a special stats message. It operates on the assumption that the backends aren't actually going to read the statistics file very often, compared to how frequent it's written today. Magnus Hagander
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 00631b3e12..4497e4d1f5 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.43 2006/04/06 20:38:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.44 2006/04/27 00:06:59 momjian Exp $
* ----------
*/
#ifndef PGSTAT_H
@@ -32,7 +32,8 @@ typedef enum StatMsgType
PGSTAT_MTYPE_RESETCOUNTER,
PGSTAT_MTYPE_AUTOVAC_START,
PGSTAT_MTYPE_VACUUM,
- PGSTAT_MTYPE_ANALYZE
+ PGSTAT_MTYPE_ANALYZE,
+ PGSTAT_MTYPE_REWRITE
} StatMsgType;
/* ----------
@@ -108,6 +109,15 @@ typedef struct PgStat_MsgDummy
} PgStat_MsgDummy;
/* ----------
+ * PgStat_MsgRewrite Sent by backends to cause a rewrite of the stats file
+ * ----------
+ */
+typedef struct Pgstat_MsgRewrite
+{
+ PgStat_MsgHdr m_hdr;
+} PgStat_MsgRewrite;
+
+/* ----------
* PgStat_MsgBestart Sent by the backend on startup
* ----------
*/