Updated on 2024-05-07 GMT+08:00

PG_STAT_BGWRITER

PG_STAT_BGWRITER displays statistics about the activity of the background writer process.

Table 1 PG_STAT_BGWRITER columns

Name

Type

Description

checkpoints_timed

bigint

Number of scheduled checkpoints that have been performed.

checkpoints_req

bigint

Number of checkpoints that have been performed actively.

checkpoint_write_time

double precision

Total time spent in the checkpoint processing portion when writing files to disk, in milliseconds.

checkpoint_sync_time

double precision

Total time spent in the checkpoint processing portion when synchronizing files to disk, in milliseconds.

buffers_checkpoint

bigint

Number of buffers written by checkpoints.

buffers_clean

bigint

Number of buffers written by the background writer process.

maxwritten_clean

bigint

Number of times that cleanup scanning stops because the background writer process writes too many buffers.

buffers_backend

bigint

Number of buffers written directly by the backend.

buffers_backend_fsync

bigint

Number of times that the backend calls fsync (usually, even if the backend executes these write actions, the background writer process processes them again).

buffers_alloc

bigint

Number of buffers allocated

stats_reset

timestamp with time zone

Time at which these statistics were last reset