From aebe989477ac5a9f7b59ae464ec68ec45975ed3f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 29 Apr 2012 13:24:44 -0400 Subject: [PATCH] Make a copy-editing pass over the new documentation for statistics views. Fix a bunch of typos, improve markup, make wording more uniform, rearrange some material. No substantive changes. --- doc/src/sgml/monitoring.sgml | 1282 +++++++++++++++++----------------- 1 file changed, 633 insertions(+), 649 deletions(-) diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 0eb085e213..1f4f0929e3 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -140,13 +140,13 @@ postgres: user database host - The parameter controls whether - statistics are collected about table and index accesses. + The parameter enables monitoring + of the current command being executed by any server process. - The parameter enables monitoring - of block read and write times. + The parameter controls whether + statistics are collected about table and index accesses. @@ -155,8 +155,8 @@ postgres: user database host - The parameter enables monitoring - of the current command being executed by any server process. + The parameter enables monitoring + of block read and write times. @@ -170,13 +170,16 @@ postgres: user database host - The statistics collector transmits the collected - information to backends (including autovacuum) through temporary files. - These files are stored in the pg_stat_tmp subdirectory. - When the postmaster shuts down, a permanent copy of the statistics - data is stored in the global subdirectory. For increased - performance, the parameter can - be pointed at a RAM-based file system, decreasing physical I/O requirements. + The statistics collector transmits the collected information to other + PostgreSQL processes through temporary files. + These files are stored in the directory named by the + parameter, + pg_stat_tmp by default. + For better performance, stats_temp_directory can be + pointed at a RAM-based file system, decreasing physical I/O requirements. + When the server shuts down, a permanent copy of the statistics + data is stored in the global subdirectory, so that + statistics can be retained across server restarts. @@ -188,7 +191,8 @@ postgres: user database host , are available to show the results of statistics collection. Alternatively, one can - build custom views using the underlying statistics functions. + build custom views using the underlying statistics functions, as discussed + in . @@ -198,7 +202,7 @@ postgres: user database host PGSTAT_STAT_INTERVAL - milliseconds (500 unless altered while building the server). So the + milliseconds (500 msec unless altered while building the server). So the displayed information lags behind actual activity. However, current-query information collected by track_activities is always up-to-date. @@ -229,10 +233,8 @@ postgres: user database host pg_stat_xact_all_tables, pg_stat_xact_sys_tables, pg_stat_xact_user_tables, and - pg_stat_xact_user_functions, or via these views' underlying - functions (named the same as the standard statistics functions but with the - prefix pg_stat_get_xact_). These numbers do not act - as stated above; instead they update continuously throughout the transaction. + pg_stat_xact_user_functions. These numbers do not act as + stated above; instead they update continuously throughout the transaction. @@ -253,58 +255,33 @@ postgres: user database host pg_stat_activity - One row per server process, showing information related to - each connection to the server. Unless the - parameter has been turned - off, it is possible to monitor state and query information of - all running processes. - - - See for more details. - - + One row per server process, showing information related to + the current activity of that process, such as state and current query. + See for details. + pg_stat_bgwriterpg_stat_bgwriter - One row only, showing cluster-wide statistics. See - for more details. + One row only, showing statistics about the + background writer process's activity. See + for details. pg_stat_databasepg_stat_database One row per database, showing database-wide statistics. See - for more details. + for details. - - pg_stat_database_conflictspg_stat_database_conflicts - - One row per database showing database-wide statistics about - query cancels due to conflict with recovery on standby servers. - Will only contain information on standby servers, since - conflicts do not occur on master servers. - See for more details. - - - - - pg_stat_replicationpg_stat_replication - One row per WAL sender process, showing statistics about the - replication to this slave. See - for more details. Only directly connected standbys are listed; no - information about downstream standby servers is recorded. - - - pg_stat_all_tablespg_stat_all_tables - One row for each table in the current database (including TOAST - tables) with information about accesses to this specific table. - See for more details. + One row for each table in the current database, showing statistics + about accesses to that specific table. + See for details. @@ -344,9 +321,9 @@ postgres: user database host pg_stat_all_indexespg_stat_all_indexes - One row for each index in the current database with information - about accesses to this specific index. - See for more details. + One row for each index in the current database, showing statistics + about accesses to that specific index. + See for details. @@ -365,9 +342,9 @@ postgres: user database host pg_statio_all_tablespg_statio_all_tables - One row for each table in the current database (including TOAST - tables) with information about I/O on this specific table. - See for more details. + One row for each table in the current database, showing statistics + about I/O on that specific table. + See for details. @@ -386,9 +363,9 @@ postgres: user database host pg_statio_all_indexespg_statio_all_indexes - One row for each index in the current database - with information about I/O on this specific index. - See for more details. + One row for each index in the current database, + showing statistics about I/O on that specific index. + See for details. @@ -407,9 +384,9 @@ postgres: user database host pg_statio_all_sequencespg_statio_all_sequences - One row for each sequence in the current database - with information about I/O on this specific sequence. - See for more details. + One row for each sequence in the current database, + showing statistics about I/O on that specific sequence. + See for details. @@ -429,9 +406,9 @@ postgres: user database host pg_stat_user_functionspg_stat_user_functions - One row for each tracked function (as specified by the - parameter). See - for more details. + One row for each tracked function, showing statistics + about executions of that function. See + for details. @@ -442,6 +419,23 @@ postgres: user database host pg_stat_user_functions). + + pg_stat_replicationpg_stat_replication + One row per WAL sender process, showing statistics about + replication to that sender's connected standby server. + See for details. + + + + + pg_stat_database_conflictspg_stat_database_conflicts + + One row per database, showing database-wide statistics about + query cancels due to conflict with recovery on standby servers. + See for details. + + +
@@ -451,33 +445,6 @@ postgres: user database host - - Indexes can be - used either directly or via bitmap scans. In a bitmap scan - the output of several indexes can be combined via AND or OR rules; - so it is difficult to associate individual heap row fetches - with specific indexes when a bitmap scan is used. Therefore, a bitmap - scan increments the - pg_stat_all_indexes.idx_tup_read - count(s) for the index(es) it uses, and it increments the - pg_stat_all_tables.idx_tup_fetch - count for the table, but it does not affect - pg_stat_all_indexes.idx_tup_fetch. - - - - - Before PostgreSQL 8.1, the - idx_tup_read and idx_tup_fetch counts - were essentially always equal. Now they can be different even without - considering bitmap scans, because idx_tup_read counts - index entries retrieved from the index while idx_tup_fetch - counts live rows fetched from the table; the latter will be less if any - dead or not-yet-committed rows are fetched using the index, or if any - heap fetches are avoided by means of an index-only scan. - - - The pg_statio_ views are primarily useful to determine the effectiveness of the buffer cache. When the number @@ -495,21 +462,6 @@ postgres: user database host - - Other ways of looking at the statistics can be set up by writing - queries that use the same underlying statistics access functions as - these standard views do. These functions are listed in . The per-database access - functions take a database OID as an argument to identify which - database to report on. The per-table and per-index functions take - a table or index OID. The functions for function-call statistics - take a function OID. (Note that only tables, indexes, and functions - in the current database can be seen with these functions.) The - per-server-process access functions take a server process - number, which ranges from one to the number of currently active - server processes. - - pg_stat_activity view @@ -525,98 +477,94 @@ postgres: user database host - datid + datid oid - The OID of the database the backend is connected to. + OID of the database this backend is connected to. This value can also be returned by directly calling the pg_stat_get_backend_dbid function. - datname + datname name - The name of the database the backend is connected to. + Name of the database this backend is connected to - pid + pid integer - The process ID of the backend. + Process ID of this backend. This value can also be returned by directly calling the pg_stat_get_backend_pid. - usesysid<