diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index acc6e2bc31..41ac5d2b67 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -608,8 +608,22 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser into the kernel's handling of I/O. + - + + <structname>pg_stat_activity</structname> + + + 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. + + +
<structname>pg_stat_activity</structname> View @@ -889,12 +903,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
- - 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 @@ -2135,15 +2143,31 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser 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) - + + + + <structname>pg_stat_replication</structname> + + + 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. + + +
<structname>pg_stat_replication</structname> View @@ -2457,13 +2481,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
- - 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, @@ -2503,7 +2520,22 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
- + + + + <structname>pg_stat_wal_receiver</structname> + + + 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. + + +
<structname>pg_stat_wal_receiver</structname> View @@ -2668,13 +2700,23 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+ + + + <structname>pg_stat_subscription</structname> + + + 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. - +
<structname>pg_stat_subscription</structname> View @@ -2776,14 +2818,25 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_ssl</structname> + + + 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. - +
<structname>pg_stat_ssl</structname> View @@ -2896,16 +2949,25 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_gssapi</structname> + + + pg_stat_gssapi + + - 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 + 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. - +
<structname>pg_stat_gssapi</structname> View @@ -2962,17 +3024,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_archiver</structname> + + + 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. - - +
<structname>pg_stat_archiver</structname> View @@ -3053,12 +3119,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_bgwriter</structname> + + + pg_stat_bgwriter + + - The pg_stat_archiver view will always have a - single row, containing data about the archiver process of the cluster. + The pg_stat_bgwriter view will always have a + single row, containing global data for the cluster. - +
<structname>pg_stat_bgwriter</structname> View @@ -3181,12 +3256,22 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_database</structname> + + + 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. - +
<structname>pg_stat_database</structname> View @@ -3416,13 +3501,24 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_database_conflicts</structname> + + + 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. - +
<structname>pg_stat_database_conflicts</structname> View @@ -3508,15 +3604,26 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_all_tables</structname> + + + 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. - +
<structname>pg_stat_all_tables</structname> View @@ -3748,17 +3855,26 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_all_indexes</structname> + + + pg_stat_all_indexes + + - 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 + 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 tables respectively. + but filtered to only show user and system indexes respectively. - +
<structname>pg_stat_all_indexes</structname> View @@ -3849,16 +3965,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
- - 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 @@ -3888,7 +3994,26 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i - + + + + <structname>pg_statio_all_tables</structname> + + + 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. + + +
<structname>pg_statio_all_tables</structname> View @@ -4005,96 +4130,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
- - 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. - +
- - <structname>pg_statio_all_indexes</structname> View - - - - - Column Type - - - Description - - - + + <structname>pg_statio_all_indexes</structname> - - - - relid oid - - - OID of the table for this index - - - - - - indexrelid oid - - - OID of this index - - - - - - schemaname name - - - Name of the schema this index is in - - - - - - relname name - - - Name of the table for this index - - - - - - indexrelname name - - - Name of this index - - - - - - idx_blks_read bigint - - - Number of disk blocks read from this index - - - - - - idx_blks_hit bigint - - - Number of buffer hits in this index - - - - -
+ + pg_statio_all_indexes + The pg_statio_all_indexes view will contain @@ -4106,7 +4149,103 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i but filtered to only show user and system indexes respectively. - +
+ <structname>pg_statio_all_indexes</structname> View + + + + + Column Type + + + Description + + + + + + + + relid oid + + + OID of the table for this index + + + + + + indexrelid oid + + + OID of this index + + + + + + schemaname name + + + Name of the schema this index is in + + + + + + relname name + + + Name of the table for this index + + + + + + indexrelname name + + + Name of this index + + + + + + idx_blks_read bigint + + + Number of disk blocks read from this index + + + + + + idx_blks_hit bigint + + + Number of buffer hits in this index + + + + +
+ + + + + <structname>pg_statio_all_sequences</structname> + + + pg_statio_all_sequences + + + + 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. + + + <structname>pg_statio_all_sequences</structname> View @@ -4169,13 +4308,23 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_user_functions</structname> + + + 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. - +
<structname>pg_stat_user_functions</structname> View @@ -4249,10 +4398,19 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
+
+ + + <structname>pg_stat_slru</structname> + SLRU + + pg_stat_slru + + PostgreSQL accesses certain on-disk information via SLRU (simple least-recently-used) caches. @@ -4261,7 +4419,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i to cached pages. - +
<structname>pg_stat_slru</structname> View @@ -4362,13 +4520,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
- - 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. - -