mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
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.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user