Thread: pgsql: Change the pgstat logic so that the stats collector writes the
pgsql: Change the pgstat logic so that the stats collector writes the
From
tgl@postgresql.org (Tom Lane)
Date:
Log Message: ----------- Change the pgstat logic so that the stats collector writes the stats file only upon requests from backends, rather than on a fixed 500msec cycle. (There's still throttling logic to ensure it writes no more often than once per 500msec, though.) This should result in a significant reduction in stats file write traffic in typical scenarios where the stats are demanded only infrequently. This approach also means that the former difficulty with changing stats_temp_directory on-the-fly has gone away, so remove the caution about that as well as the thrashing we did to minimize the trouble window. In passing, also fix pgstat_report_stat() so that we will send a stats message if we have function call stats but not table stats to report; this fixes a bug in the recent patch to support function-call stats. Martin Pihlak Modified Files: -------------- pgsql/doc/src/sgml: config.sgml (r1.191 -> r1.192) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/config.sgml?r1=1.191&r2=1.192) pgsql/src/backend/postmaster: pgstat.c (r1.181 -> r1.182) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/pgstat.c?r1=1.181&r2=1.182) pgsql/src/include: pgstat.h (r1.78 -> r1.79) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/pgstat.h?r1=1.78&r2=1.79)