↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

System Catalogs / Statistics views

The pg_stat_io view will contain one row for each combination of backend type, target I/O object, and I/O context, showing cluster-wide I/O statistics.

Reading PG 18current·documented in 5 of 24 versions, 16 to 20

Kind
Statistics views
Columns in this snapshot
20
Definition source
English manual
Metadata snapshot
18.6

Columns 20

As listed in the PostgreSQL 18 manual.

ColumnTypeDescription / reference
backend_typetextType of backend (e.g. background worker, autovacuum worker). See pg_stat_activity for more information on backend_types. Some backend_types do not accumulate I/O operation statistics and will not be included in the view.
objecttextTarget object of an I/O operation. Possible values are: relation: Permanent relations. temp relation: Temporary relations. wal: Write Ahead Logs.
contexttextThe context of an I/O operation. Possible values are: normal: The default or standard context for a type of I/O operation. For example, by default, relation data is read into and written out from shared buffers. Thus, reads and writes of relation data to and from shared buffers are tracked in context normal. init: I/O operations performed while creating the WAL segments are tracked in context init. vacuum: I/O operations performed outside of shared buffers while vacuuming and analyzing permanent relations. Temporary table vacuums use the same local buffer pool as other temporary table I/O operations and are tracked in context normal. bulkread: Certain large read I/O operations done outside of shared buffers, for example, a sequential scan of a large table. bulkwrite: Certain large write I/O operations done outside of shared buffers, such as COPY.
readsbigintNumber of read operations.
read_bytesnumericThe total size of read operations in bytes.
read_timedouble precisionTime spent waiting for read operations in milliseconds (if track_io_timing is enabled and object is not wal, or if track_wal_io_timing is enabled and object is wal, otherwise zero)
writesbigintNumber of write operations.
write_bytesnumericThe total size of write operations in bytes.
write_timedouble precisionTime spent waiting for write operations in milliseconds (if track_io_timing is enabled and object is not wal, or if track_wal_io_timing is enabled and object is wal, otherwise zero)
writebacksbigintNumber of units of size BLCKSZ (typically 8kB) which the process requested the kernel write out to permanent storage.
writeback_timedouble precisionTime spent waiting for writeback operations in milliseconds (if track_io_timing is enabled, otherwise zero). This includes the time spent queueing write-out requests and, potentially, the time spent to write out the dirty data.
extendsbigintNumber of relation extend operations.
extend_bytesnumericThe total size of relation extend operations in bytes.
extend_timedouble precisionTime spent waiting for extend operations in milliseconds. (if track_io_timing is enabled and object is not wal, or if track_wal_io_timing is enabled and object is wal, otherwise zero)
hitsbigintThe number of times a desired block was found in a shared buffer.
evictionsbigintNumber of times a block has been written out from a shared or local buffer in order to make it available for another use. In context normal, this counts the number of times a block was evicted from a buffer and replaced with another block. In contexts bulkwrite, bulkread, and vacuum, this counts the number of times a block was evicted from shared buffers in order to add the shared buffer to a separate, size-limited ring buffer for use in a bulk I/O operation.
reusesbigintThe number of times an existing buffer in a size-limited ring buffer outside of shared buffers was reused as part of an I/O operation in the bulkread, bulkwrite, or vacuum contexts.
fsyncsbigintNumber of fsync calls. These are only tracked in context normal.
fsync_timedouble precisionTime spent waiting for fsync operations in milliseconds (if track_io_timing is enabled and object is not wal, or if track_wal_io_timing is enabled and object is wal, otherwise zero)
stats_resettimestamp with time zoneTime at which these statistics were last reset.
Column history across versions
Version history 4
  1. 18 → 19 reworded
  2. 17 → 18 changed
  3. 16 → 17 reworded
  4. 15 → 16 added

Definition snapshot: english-manuals:a988e06d8d8fb9a062eea416969… · English manual source