Updated on 2025-07-22 GMT+08:00

BGWRITER_STAT

BGWRITER_STAT displays statistics about the background writer process's activities.

Table 1 BGWRITER_STAT columns

Name

Type

Description

checkpoints_timed

bigint

Number of scheduled checkpoints that have been performed

checkpoints_req

bigint

Number of requested checkpoints that have been performed

checkpoint_write_time

double precision

Total time spent on performing write operations during checkpointing (unit: ms).

checkpoint_sync_time

double precision

Total time spent on performing sync operations during checkpointing (unit: ms).

buffers_checkpoint

bigint

Number of buffers written during checkpointing.

buffers_clean

bigint

Number of buffers that have been written to a disk by the BGWRITER thread.

maxwritten_clean

bigint

Number of times that the BGWRITER thread stops cleanup scanning because the number of pages refreshed in a single scan is too large.

buffers_backend

bigint

Number of buffers written directly by the backend.

buffers_backend_fsync

bigint

Number of times that the backend thread automatically executes fsync. Generally, fsync is called by the BGWRITER thread.

buffers_alloc

bigint

Number of buffers allocated

stats_reset

timestamp with time zone

Time when the statistics of the current row were reset last time.