pg_stat_bgwriter

A statistics view showing information about checkpoints and disk writes

pg_stat_bgwriter is a statistics view showing information about checkpoints and disk writes. Note that contrary to what the view name and the PostgreSQL documentation imply, the statistics are not specific to the background writer process.

pg_stat_bgwriter was added in PostgreSQL 8.3 (commit 335feca4).

Definition by PostgreSQL version

pg_stat_bgwriter (PostgreSQL 13)

                        View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+---------
 checkpoints_timed     | bigint                   |           |          |
 checkpoints_req       | bigint                   |           |          |
 checkpoint_write_time | double precision         |           |          |
 checkpoint_sync_time  | double precision         |           |          |
 buffers_checkpoint    | bigint                   |           |          |
 buffers_clean         | bigint                   |           |          |
 maxwritten_clean      | bigint                   |           |          |
 buffers_backend       | bigint                   |           |          |
 buffers_backend_fsync | bigint                   |           |          |
 buffers_alloc         | bigint                   |           |          |
 stats_reset           | timestamp with time zone |           |          |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 12)

                        View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+---------
 checkpoints_timed     | bigint                   |           |          |
 checkpoints_req       | bigint                   |           |          |
 checkpoint_write_time | double precision         |           |          |
 checkpoint_sync_time  | double precision         |           |          |
 buffers_checkpoint    | bigint                   |           |          |
 buffers_clean         | bigint                   |           |          |
 maxwritten_clean      | bigint                   |           |          |
 buffers_backend       | bigint                   |           |          |
 buffers_backend_fsync | bigint                   |           |          |
 buffers_alloc         | bigint                   |           |          |
 stats_reset           | timestamp with time zone |           |          |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 11)

                        View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+---------
 checkpoints_timed     | bigint                   |           |          |
 checkpoints_req       | bigint                   |           |          |
 checkpoint_write_time | double precision         |           |          |
 checkpoint_sync_time  | double precision         |           |          |
 buffers_checkpoint    | bigint                   |           |          |
 buffers_clean         | bigint                   |           |          |
 maxwritten_clean      | bigint                   |           |          |
 buffers_backend       | bigint                   |           |          |
 buffers_backend_fsync | bigint                   |           |          |
 buffers_alloc         | bigint                   |           |          |
 stats_reset           | timestamp with time zone |           |          |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 10)

                        View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+---------
 checkpoints_timed     | bigint                   |           |          |
 checkpoints_req       | bigint                   |           |          |
 checkpoint_write_time | double precision         |           |          |
 checkpoint_sync_time  | double precision         |           |          |
 buffers_checkpoint    | bigint                   |           |          |
 buffers_clean         | bigint                   |           |          |
 maxwritten_clean      | bigint                   |           |          |
 buffers_backend       | bigint                   |           |          |
 buffers_backend_fsync | bigint                   |           |          |
 buffers_alloc         | bigint                   |           |          |
 stats_reset           | timestamp with time zone |           |          |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.6)

              View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Modifiers
-----------------------+--------------------------+-----------
 checkpoints_timed     | bigint                   |
 checkpoints_req       | bigint                   |
 checkpoint_write_time | double precision         |
 checkpoint_sync_time  | double precision         |
 buffers_checkpoint    | bigint                   |
 buffers_clean         | bigint                   |
 maxwritten_clean      | bigint                   |
 buffers_backend       | bigint                   |
 buffers_backend_fsync | bigint                   |
 buffers_alloc         | bigint                   |
 stats_reset           | timestamp with time zone |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.5)

              View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Modifiers
-----------------------+--------------------------+-----------
 checkpoints_timed     | bigint                   |
 checkpoints_req       | bigint                   |
 checkpoint_write_time | double precision         |
 checkpoint_sync_time  | double precision         |
 buffers_checkpoint    | bigint                   |
 buffers_clean         | bigint                   |
 maxwritten_clean      | bigint                   |
 buffers_backend       | bigint                   |
 buffers_backend_fsync | bigint                   |
 buffers_alloc         | bigint                   |
 stats_reset           | timestamp with time zone |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.4)

              View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Modifiers
-----------------------+--------------------------+-----------
 checkpoints_timed     | bigint                   |
 checkpoints_req       | bigint                   |
 checkpoint_write_time | double precision         |
 checkpoint_sync_time  | double precision         |
 buffers_checkpoint    | bigint                   |
 buffers_clean         | bigint                   |
 maxwritten_clean      | bigint                   |
 buffers_backend       | bigint                   |
 buffers_backend_fsync | bigint                   |
 buffers_alloc         | bigint                   |
 stats_reset           | timestamp with time zone |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.3)

              View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Modifiers
-----------------------+--------------------------+-----------
 checkpoints_timed     | bigint                   |
 checkpoints_req       | bigint                   |
 checkpoint_write_time | double precision         |
 checkpoint_sync_time  | double precision         |
 buffers_checkpoint    | bigint                   |
 buffers_clean         | bigint                   |
 maxwritten_clean      | bigint                   |
 buffers_backend       | bigint                   |
 buffers_backend_fsync | bigint                   |
 buffers_alloc         | bigint                   |
 stats_reset           | timestamp with time zone |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.2)

              View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Modifiers
-----------------------+--------------------------+-----------
 checkpoints_timed     | bigint                   |
 checkpoints_req       | bigint                   |
 checkpoint_write_time | double precision         |
 checkpoint_sync_time  | double precision         |
 buffers_checkpoint    | bigint                   |
 buffers_clean         | bigint                   |
 maxwritten_clean      | bigint                   |
 buffers_backend       | bigint                   |
 buffers_backend_fsync | bigint                   |
 buffers_alloc         | bigint                   |
 stats_reset           | timestamp with time zone |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.1)

              View "pg_catalog.pg_stat_bgwriter"
        Column         |           Type           | Modifiers
-----------------------+--------------------------+-----------
 checkpoints_timed     | bigint                   |
 checkpoints_req       | bigint                   |
 buffers_checkpoint    | bigint                   |
 buffers_clean         | bigint                   |
 maxwritten_clean      | bigint                   |
 buffers_backend       | bigint                   |
 buffers_backend_fsync | bigint                   |
 buffers_alloc         | bigint                   |
 stats_reset           | timestamp with time zone |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 9.0)

   View "pg_catalog.pg_stat_bgwriter"
       Column       |  Type  | Modifiers
--------------------+--------+-----------
 checkpoints_timed  | bigint |
 checkpoints_req    | bigint |
 buffers_checkpoint | bigint |
 buffers_clean      | bigint |
 maxwritten_clean   | bigint |
 buffers_backend    | bigint |
 buffers_alloc      | bigint |
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 8.4)

   View "pg_catalog.pg_stat_bgwriter"
       Column       |  Type  | Modifiers
--------------------+--------+-----------
 checkpoints_timed  | bigint |
 checkpoints_req    | bigint |
 buffers_checkpoint | bigint |
 buffers_clean      | bigint |
 maxwritten_clean   | bigint |
 buffers_backend    | bigint |
 buffers_alloc      | bigint |
View definition:
 SELECT pg_stat_get_bgwriter_timed_checkpoints() AS checkpoints_timed, pg_stat_get_bgwriter_requested_checkpoints() AS checkpoints_req, pg_stat_get_bgwriter_buf_written_checkpoints() AS buffers_checkpoint, pg_stat_get_bgwriter_buf_written_clean() AS buffers_clean, pg_stat_get_bgwriter_maxwritten_clean() AS maxwritten_clean, pg_stat_get_buf_written_backend() AS buffers_backend, pg_stat_get_buf_alloc() AS buffers_alloc;
    

Documentation: pg_stat_bgwriter

pg_stat_bgwriter (PostgreSQL 8.3)

   View "pg_catalog.pg_stat_bgwriter"
       Column       |  Type  | Modifiers
--------------------+--------+-----------
 checkpoints_timed  | bigint |
 checkpoints_req    | bigint |
 buffers_checkpoint | bigint |
 buffers_clean      | bigint |
 maxwritten_clean   | bigint |
 buffers_backend    | bigint |
 buffers_alloc      | bigint |
View definition:
 SELECT pg_stat_get_bgwriter_timed_checkpoints() AS checkpoints_timed, pg_stat_get_bgwriter_requested_checkpoints() AS checkpoints_req, pg_stat_get_bgwriter_buf_written_checkpoints() AS buffers_checkpoint, pg_stat_get_bgwriter_buf_written_clean() AS buffers_clean, pg_stat_get_bgwriter_maxwritten_clean() AS maxwritten_clean, pg_stat_get_buf_written_backend() AS buffers_backend, pg_stat_get_buf_alloc() AS buffers_alloc;
    

Documentation: pg_stat_bgwriter

Change history

Categories

Statistics / monitoring view, Storage

See also

background writer