diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-28 00:02:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-06-28 00:02:40 +0000 |
commit | 867e2c91a0c341111b7a5257dc4c9a2659a022dc (patch) | |
tree | 088aa81d027903d3293e8a7d978801678f8a403a /src/backend/utils/adt/pgstatfuncs.c | |
parent | b09c248bdd3d0d86714865d2142604aea789e840 (diff) | |
download | postgresql-867e2c91a0c341111b7a5257dc4c9a2659a022dc.tar.gz postgresql-867e2c91a0c341111b7a5257dc4c9a2659a022dc.zip |
Implement "distributed" checkpoints in which the checkpoint I/O is spread
over a fairly long period of time, rather than being spat out in a burst.
This happens only for background checkpoints carried out by the bgwriter;
other cases, such as a shutdown checkpoint, are still done at full speed.
Remove the "all buffers" scan in the bgwriter, and associated stats
infrastructure, since this seems no longer very useful when the checkpoint
itself is properly throttled.
Original patch by Itagaki Takahiro, reworked by Heikki Linnakangas,
and some minor API editorialization by me.
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
-rw-r--r-- | src/backend/utils/adt/pgstatfuncs.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 4f2eb287dc9..6fab06dae59 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/pgstatfuncs.c,v 1.42 2007/05/17 23:31:49 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/pgstatfuncs.c,v 1.43 2007/06/28 00:02:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -64,10 +64,8 @@ extern Datum pg_stat_get_db_tuples_deleted(PG_FUNCTION_ARGS); extern Datum pg_stat_get_bgwriter_timed_checkpoints(PG_FUNCTION_ARGS); extern Datum pg_stat_get_bgwriter_requested_checkpoints(PG_FUNCTION_ARGS); extern Datum pg_stat_get_bgwriter_buf_written_checkpoints(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_buf_written_lru(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_buf_written_all(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_maxwritten_lru(PG_FUNCTION_ARGS); -extern Datum pg_stat_get_bgwriter_maxwritten_all(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_bgwriter_buf_written_clean(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_bgwriter_maxwritten_clean(PG_FUNCTION_ARGS); extern Datum pg_stat_clear_snapshot(PG_FUNCTION_ARGS); extern Datum pg_stat_reset(PG_FUNCTION_ARGS); @@ -787,27 +785,15 @@ pg_stat_get_bgwriter_buf_written_checkpoints(PG_FUNCTION_ARGS) } Datum -pg_stat_get_bgwriter_buf_written_lru(PG_FUNCTION_ARGS) +pg_stat_get_bgwriter_buf_written_clean(PG_FUNCTION_ARGS) { - PG_RETURN_INT64(pgstat_fetch_global()->buf_written_lru); + PG_RETURN_INT64(pgstat_fetch_global()->buf_written_clean); } Datum -pg_stat_get_bgwriter_buf_written_all(PG_FUNCTION_ARGS) +pg_stat_get_bgwriter_maxwritten_clean(PG_FUNCTION_ARGS) { - PG_RETURN_INT64(pgstat_fetch_global()->buf_written_all); -} - -Datum -pg_stat_get_bgwriter_maxwritten_lru(PG_FUNCTION_ARGS) -{ - PG_RETURN_INT64(pgstat_fetch_global()->maxwritten_lru); -} - -Datum -pg_stat_get_bgwriter_maxwritten_all(PG_FUNCTION_ARGS) -{ - PG_RETURN_INT64(pgstat_fetch_global()->maxwritten_all); + PG_RETURN_INT64(pgstat_fetch_global()->maxwritten_clean); } |