has flushed to disk, and the last position it has applied.
One row per server process, showing information related to
the current activity of that process, such as state and current query.
- See for details.
+ See
+ pg_stat_activity for details.
pg_stat_replication pg_stat_replication
One row per WAL sender process, showing statistics about
replication to that sender's connected standby server.
- See for details.
+ See
+ pg_stat_replication for details.
pg_stat_wal_receiver pg_stat_wal_receiver
Only one row, showing statistics about the WAL receiver from
that receiver's connected server.
- See for details.
+ See
+ pg_stat_wal_receiver for details.
pg_stat_subscription pg_stat_subscription
At least one row per subscription, showing information about
the subscription workers.
- See for details.
+ See
+ pg_stat_subscription for details.
One row per connection (regular and replication), showing information about
SSL used on this connection.
- See for details.
+ See
+ pg_stat_ssl for details.
pg_stat_gssapi pg_stat_gssapi
One row per connection (regular and replication), showing information about
GSSAPI authentication and encryption used on this connection.
- See for details.
+ See
+ pg_stat_gssapi for details.
pg_stat_archiver pg_stat_archiver
One row only, showing statistics about the
WAL archiver process's activity. See
- for details.
+
+ pg_stat_archiver for details.
pg_stat_bgwriter pg_stat_bgwriter
One row only, showing statistics about the
background writer process's activity. See
- for details.
+
+ pg_stat_bgwriter for details.
|
pg_stat_database pg_stat_database
One row per database, showing database-wide statistics. See
- for details.
+
+ pg_stat_database for details.
One row per database, showing database-wide statistics about
query cancels due to conflict with recovery on standby servers.
- See for details.
+ See
+ pg_stat_database_conflicts for details.
One row for each table in the current database, showing statistics
about accesses to that specific table.
- See for details.
+ See
+ pg_stat_all_tables for details.
One row for each index in the current database, showing statistics
about accesses to that specific index.
- See for details.
+ See
+ pg_stat_all_indexes for details.
One row for each table in the current database, showing statistics
about I/O on that specific table.
- See for details.
+ See
+ pg_statio_all_tables for details.
One row for each index in the current database,
showing statistics about I/O on that specific index.
- See for details.
+ See
+ pg_statio_all_indexes for details.
One row for each sequence in the current database,
showing statistics about I/O on that specific sequence.
- See for details.
+ See
+ pg_statio_all_sequences for details.
One row for each tracked function, showing statistics
about executions of that function. See
- for details.
+
+ pg_stat_user_functions for details.
|
One row per SLRU, showing statistics of operations. See
- for details.
+
+ pg_stat_slru for details.
into the kernel's handling of I/O.
+
+
+
+
pg_stat_activity
+
+
+
+
+ The pg_stat_activity view will have one row
+ per server process, showing information related to
+ the current activity of that process.
+
- The pg_stat_activity view will have one row
- per server process, showing information related to
- the current activity of that process.
-
-
The wait_event and state columns are
SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event is NOT NULL;
- pid | wait_event_type | wait_event
-------+-----------------+---------------
+ pid | wait_event_type | wait_event
+------+-----------------+------------
2540 | Lock | relation
- 6644 | LWLock | ProcArrayLock
+ 6644 | LWLock | ProcArray
(2 rows)
+
+
+
+
pg_stat_replication
+
+
+
+
+ The pg_stat_replication view will contain one row
+ per WAL sender process, showing statistics about replication to that
+ sender's connected standby server. Only directly connected standbys are
+ listed; no information is available about downstream standby servers.
+
+
- The pg_stat_replication view will contain one row
- per WAL sender process, showing statistics about replication to that
- sender's connected standby server. Only directly connected standbys are
- listed; no information is available about downstream standby servers.
-
-
The lag times reported in the pg_stat_replication
view are measurements of the time taken for recent WAL to be written,
+
+
+
+
pg_stat_wal_receiver
+
+
+
+
+ The pg_stat_wal_receiver view will contain only
+ one row, showing statistics about the WAL receiver from that receiver's
+ connected server.
+
+
pg_stat_wal_receiver View
+
+
+
+
pg_stat_subscription
+
+
+
+
- The pg_stat_wal_receiver view will contain only
- one row, showing statistics about the WAL receiver from that receiver's
- connected server.
+ The pg_stat_subscription view will contain one
+ row per subscription for main worker (with null PID if the worker is
+ not running), and additional rows for workers handling the initial data
+ copy of the subscribed tables.
+
+
+
+
pg_stat_ssl
+
+
+
+
- The pg_stat_subscription view will contain one
- row per subscription for main worker (with null PID if the worker is
- not running), and additional rows for workers handling the initial data
- copy of the subscribed tables.
+ The pg_stat_ssl view will contain one row per
+ backend or WAL sender process, showing statistics about SSL usage on
+ this connection. It can be joined to pg_stat_activity
+ or pg_stat_replication on the
+ pid column to get more details about the
+ connection.
+
+
+
+
pg_stat_gssapi
+
+
+
+
- The pg_stat_ssl view will contain one row per
- backend or WAL sender process, showing statistics about SSL usage o n
- this connection. It can be joined to pg_stat_activity
- or pg_stat_replication on the
+ The pg_stat_gssapi view will contain one row per
+ backend, showing information about GSSAPI usage on this connection. It ca n
+ be joined to pg_stat_activity or
+ pg_stat_replication on the
pid column to get more details about the
connection.
+
+
+
+
pg_stat_archiver
+
+
+
+
- The pg_stat_gssapi view will contain one row per
- backend, showing information about GSSAPI usage on this connection. It can
- be joined to pg_stat_activity or
- pg_stat_replication on the
- pid column to get more details about the
- connection.
+ The pg_stat_archiver view will always have a
+ single row, containing data about the archiver process of the cluster.
-
+
+
+
+
pg_stat_bgwriter
+
+
+
+
- The pg_stat_archiv er view will always have a
- single row, containing data about the archiver process of the cluster.
+ The pg_stat_bgwrit er view will always have a
+ single row, containing global data for the cluster.
+
+
+
+
pg_stat_database
+
+
+
+
- The pg_stat_bgwriter view will always have a
- single row, containing global data for the cluster.
+ The pg_stat_database view will contain one row
+ for each database in the cluster, plus one for shared objects, showing
+ database-wide statistics.
Number of queries canceled due to conflicts with recovery
in this database. (Conflicts occur only on standby servers; see
- for details.)
+
+ pg_stat_database_conflicts for details.)
+
+
+
+
pg_stat_database_conflicts
+
+
+
pg_stat_database_conflicts
+
+
- The pg_stat_database view will contain one row
- for each database in the cluster, plus one for shared objects, showing
- database-wide statistics.
+ The pg_stat_database_conflicts view will contain
+ one row per database, showing database-wide statistics about
+ query cancels occurring due to conflicts with recovery on standby servers.
+ This view will only contain information on standby servers, since
+ conflicts do not occur on master servers.
+
+
+
+
pg_stat_all_tables
+
+
+
+
- The pg_stat_database_conflicts view will contain
- one row per database, showing database-wide statistics about
- query cancels occurring due to conflicts with recovery on standby servers.
- This view will only contain information on standby servers, since
- conflicts do not occur on master servers.
+ The pg_stat_all_tables view will contain
+ one row for each table in the current database (including TOAST
+ tables), showing statistics about accesses to that specific table. The
+ pg_stat_user_tables and
+ pg_stat_sys_tables views
+ contain the same information,
+ but filtered to only show user and system tables respectively.
+
+
+
+
pg_stat_all_indexes
+
+
+
+
- The pg_stat_all_tabl es view will contain
- one row for each table in the current database (including TOAST
- tables), showing statistics about accesses to that specific table . The
- pg_stat_user_tabl es and
- pg_stat_sys_tabl es views
+ The pg_stat_all_index es view will contain
+ one row for each index in the current database,
+ showing statistics about accesses to that specific index . The
+ pg_stat_user_index es and
+ pg_stat_sys_index es views
contain the same information,
- but filtered to only show user and system tabl es respectively.
+ but filtered to only show user and system index es respectively.
- The pg_stat_all_indexes view will contain
- one row for each index in the current database,
- showing statistics about accesses to that specific index. The
- pg_stat_user_indexes and
- pg_stat_sys_indexes views
- contain the same information,
- but filtered to only show user and system indexes respectively.
-
-
Indexes can be used by simple index scans, bitmap
index scans,
and the optimizer. In a bitmap scan
+
+
+
+
pg_statio_all_tables
+
+
+
+
+ The pg_statio_all_tables view will contain
+ one row for each table in the current database (including TOAST
+ tables), showing statistics about I/O on that specific table. The
+ pg_statio_user_tables and
+ pg_statio_sys_tables views
+ contain the same information,
+ but filtered to only show user and system tables respectively.
+
+
pg_statio_all_tables View
+
+
+
+
pg_statio_all_indexes
+
+
+
+
- The pg_statio_all_tabl es view will contain
- one row for each table in the current database (including TOAST
- tables), showing statistics about I/O on that specific table . The
- pg_statio_user_tabl es and
- pg_statio_sys_tabl es views
+ The pg_statio_all_index es view will contain
+ one row for each index in the current database,
+ showing statistics about I/O on that specific index . The
+ pg_statio_user_index es and
+ pg_statio_sys_index es views
contain the same information,
- but filtered to only show user and system tabl es respectively.
+ but filtered to only show user and system index es respectively.
+
+
+
+
pg_statio_all_sequences
+
+
+
pg_statio_all_sequences
+
+
- The pg_statio_all_indexes view will contain
- one row for each index in the current database,
- showing statistics about I/O on that specific index. The
- pg_statio_user_indexes and
- pg_statio_sys_indexes views
- contain the same information,
- but filtered to only show user and system indexes respectively.
+ The pg_statio_all_sequences view will contain
+ one row for each sequence in the current database,
+ showing statistics about I/O on that specific sequence.
+
+
+
+
pg_stat_user_functions
+
+
+
+
- The pg_statio_all_sequences view will contain
- one row for each sequence in the current database,
- showing statistics about I/O on that specific sequence.
+ The pg_stat_user_functions view will contain
+ one row for each tracked function, showing statistics about executions of
+ that function. The parameter
+ controls exactly which functions are tracked.
+
+
+
+
pg_stat_slru
+
+
+
+
PostgreSQL accesses certain on-disk information
via SLRU (simple least-recently-used) caches.
- The pg_stat_user_functions view will contain
- one row for each tracked function, showing statistics about executions of
- that function. The parameter
- controls exactly which functions are tracked.
-
-