From 96f052613f35d07d001c8dd2f284ca8d95f82d1b Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 30 Oct 2023 09:47:16 +0900 Subject: Introduce pg_stat_checkpointer Historically, the statistics of the checkpointer have been always part of pg_stat_bgwriter. This commit removes a few columns from pg_stat_bgwriter, and introduces pg_stat_checkpointer with equivalent, renamed columns (plus a new one for the reset timestamp): - checkpoints_timed -> num_timed - checkpoints_req -> num_requested - checkpoint_write_time -> write_time - checkpoint_sync_time -> sync_time - buffers_checkpoint -> buffers_written The fields of PgStat_CheckpointerStats and its SQL functions are renamed to match with the new field names, for consistency. Note that background writer and checkpointer have been split into two different processes in commits 806a2aee3791 and bf405ba8e460. The pgstat structures were already split, making this change straight-forward. Bump catalog version. Author: Bharath Rupireddy Reviewed-by: Bertrand Drouvot, Andres Freund, Michael Paquier Discussion: https://postgr.es/m/CALj2ACVxX2ii=66RypXRweZe2EsBRiPMj0aHfRfHUeXJcC7kHg@mail.gmail.com --- doc/src/sgml/monitoring.sgml | 98 +++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 23 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index faf7a5ed9d5..e068f7e2475 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -451,6 +451,15 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser + + pg_stat_checkpointerpg_stat_checkpointer + One row only, showing statistics about the + checkpointer process's activity. See + + pg_stat_checkpointer for details. + + + pg_stat_databasepg_stat_database One row per database, showing database-wide statistics. See @@ -2868,7 +2877,7 @@ description | Waiting for a newly initialized WAL file to reach durable storage The pg_stat_bgwriter view will always have a - single row, containing global data for the cluster. + single row, containing data about the background writer of the cluster. @@ -2888,77 +2897,118 @@ description | Waiting for a newly initialized WAL file to reach durable storage - checkpoints_timed bigint + buffers_clean bigint - Number of scheduled checkpoints that have been performed + Number of buffers written by the background writer - checkpoints_req bigint + maxwritten_clean bigint - Number of requested checkpoints that have been performed + Number of times the background writer stopped a cleaning + scan because it had written too many buffers - checkpoint_write_time double precision + buffers_alloc bigint - Total amount of time that has been spent in the portion of - checkpoint processing where files are written to disk, in milliseconds + Number of buffers allocated - checkpoint_sync_time double precision + stats_reset timestamp with time zone - Total amount of time that has been spent in the portion of - checkpoint processing where files are synchronized to disk, in - milliseconds + Time at which these statistics were last reset + + +
+ + + + + <structname>pg_stat_checkpointer</structname> + + pg_stat_checkpointer + + + + The pg_stat_checkpointer view will always have a + single row, containing data about the checkpointer process of the cluster. + + + + <structname>pg_stat_checkpointer</structname> View + + - buffers_checkpoint bigint + Column Type - Number of buffers written during checkpoints + Description + + - buffers_clean bigint + num_timed bigint - Number of buffers written by the background writer + Number of scheduled checkpoints that have been performed - maxwritten_clean bigint + num_requested bigint - Number of times the background writer stopped a cleaning - scan because it had written too many buffers + Number of requested checkpoints that have been performed - buffers_alloc bigint + write_time double precision - Number of buffers allocated + Total amount of time that has been spent in the portion of + checkpoint processing where files are written to disk, in milliseconds + + + + + + sync_time double precision + + + Total amount of time that has been spent in the portion of + checkpoint processing where files are synchronized to disk, in + milliseconds + + + + + + buffers_written bigint + + + Number of buffers written during checkpoints @@ -4669,8 +4719,10 @@ description | Waiting for a newly initialized WAL file to reach durable storage Resets some cluster-wide statistics counters to zero, depending on the argument. The argument can be bgwriter to reset all the counters shown in - the pg_stat_bgwriter - view, archiver to reset all the counters shown in + the pg_stat_bgwriter view, + checkpointer to reset all the counters shown in + the pg_stat_checkpointer view, + archiver to reset all the counters shown in the pg_stat_archiver view, io to reset all the counters shown in the pg_stat_io view, -- cgit v1.2.3