Updated on 2025-05-29 GMT+08:00

BGWRITER_STAT

BGWRITER_STAT displays statistics about the background writer thread's activities, as described in Table 1.

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, in milliseconds.

checkpoint_sync_time

double precision

Total time spent on performing sync operations during checkpointing, in milliseconds.

buffers_checkpoint

bigint

Number of buffers written during checkpointing.

buffers_clean

bigint

Number of buffers written 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.