Delay write of pg_stats file to once every five minutes, during
authorBruce Momjian <bruce@momjian.us>
Thu, 27 Apr 2006 00:06:59 +0000 (00:06 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 27 Apr 2006 00:06:59 +0000 (00:06 +0000)
commit944a17bf9f7f8394b693b12a5861576964cad97b
tree157441901761ab5b6b087495db2f765592f2cb3f
parenta1e5331b0745438efce46b3c9e1649a81d57796e
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
src/backend/postmaster/pgstat.c
src/include/pgstat.h