<row>
<entry><structname>pg_stat_bgwriter</><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
- <entry>One row only, showing cluster-wide statistics from the
- background writer: number of scheduled checkpoints, requested
- checkpoints, buffers written by checkpoints and cleaning scans,
- and the number of times the background writer stopped a cleaning scan
- because it had written too many buffers. Also includes
- statistics about the shared buffer pool, including buffers written
- by backends (that is, not by the background writer), how many times
- those backends had to execute their own fsync calls (normally the
- background writer handles those even when the backend does its own
- write), total buffers allocated, and time of last statistics reset.
+ <entry>One row only, showing cluster-wide statistics. See
+ <xref linkend="pg-stat-bgwriter-view"> for more details.
</entry>
</row>
<row>
<entry><structname>pg_stat_database</><indexterm><primary>pg_stat_database</primary></indexterm></entry>
- <entry>One row per database, showing database OID, database name,
- number of active server processes connected to that database,
- number of transactions committed and rolled back in that database,
- total disk blocks read, total buffer hits (i.e., block
- read requests avoided by finding the block already in buffer cache),
- number of rows returned, fetched, inserted, updated and deleted, the
- total number of queries canceled due to conflict with recovery (on
- standby servers), number and size of temporary files used, total
- number of deadlocks detected, and time of last statistics reset.
- </entry>
+ <entry>One row per database, showing database wide statistics. See
+ <xref linkend="pg-stat-database-view"> for more details.
+ </entry>
</row>
<row>
<entry><structname>pg_stat_database_conflicts</><indexterm><primary>pg_stat_database_conflicts</primary></indexterm></entry>
- <entry>One row per database, showing database OID, database name and
- the number of queries that have been canceled in this database due to
- dropped tablespaces, lock timeouts, old snapshots, pinned buffers and
- deadlocks. Will only contain information on standby servers, since
- conflicts do not occur on master servers.
+ <entry>
+ 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 <xref linkend="pg-stat-database-conflicts-view"> for more details.
</entry>
</row>
<row>
<entry><structname>pg_stat_replication</><indexterm><primary>pg_stat_replication</primary></indexterm></entry>
- <entry>One row per WAL sender process, showing process <acronym>ID</>,
- user OID, user name, application name, client's address, host name
- (if available) and port number, time at which the server process began
- execution, and the current WAL sender state and transaction log
- location. In addition, the standby reports the last transaction log
- position it received and wrote, the last position it flushed to disk,
- and the last position it replayed, and this information is also
- displayed here. If the standby's application names matches one of the
- settings in <varname>synchronous_standby_names</> then the sync_priority
- is shown here also, that is the order in which standbys will become
- the synchronous standby. The columns detailing what exactly the connection
- is doing are only visible if the user examining the view is a superuser.
- The client's host name will be available only if
- <xref linkend="guc-log-hostname"> is set or if the user's host name
- needed to be looked up during <filename>pg_hba.conf</filename>
- processing. Only directly connected standbys are listed; no information
- about downstream standby servers is recorded.
+ <entry>One row per WAL sender process, showing statistics about the
+ replication to this slave. See <xref linkend="pg-stat-replication-view">
+ for more details. Only directly connected standbys are listed; no
+ information about downstream standby servers is recorded.
</entry>
</row>
<row>
<entry><structname>pg_stat_all_tables</><indexterm><primary>pg_stat_all_tables</primary></indexterm></entry>
- <entry>For each table in the current database (including TOAST tables),
- the table OID, schema and table name, number of sequential
- scans initiated, number of live rows fetched by sequential
- scans, number of index scans initiated (over all indexes
- belonging to the table), number of live rows fetched by index
- scans, numbers of row insertions, updates, and deletions,
- number of row updates that were HOT (i.e., no separate index update),
- numbers of live and dead rows,
- the last time the table was non-<option>FULL</> vacuumed manually,
- the last time it was vacuumed by the autovacuum daemon,
- the last time it was analyzed manually,
- the last time it was analyzed by the autovacuum daemon,
- number of times it has been non-<option>FULL</> vacuumed manually,
- number of times it has been vacuumed by the autovacuum daemon,
- number of times it has been analyzed manually,
- and the number of times it has been analyzed by the autovacuum daemon.
+ <entry>
+ One row for each table in the current database (including TOAST
+ tables) with information about accesses to this specific table.
+ See <xref linkend="pg-stat-all-tables-view"> for more details.
</entry>
</row>
<row>
<entry><structname>pg_stat_all_indexes</><indexterm><primary>pg_stat_all_indexes</primary></indexterm></entry>
- <entry>For each index in the current database,
- the table and index OID, schema, table and index name,
- number of index scans initiated on that index, number of
- index entries returned by index scans, and number of live table rows
- fetched by simple index scans using that index.
+ <entry>
+ One row for each index in the current database with information
+ about accesses to this specific index.
+ See <xref linkend="pg-stat-all-indexes-view"> for more details.
</entry>
</row>
<row>
<entry><structname>pg_statio_all_tables</><indexterm><primary>pg_statio_all_tables</primary></indexterm></entry>
- <entry>For each table in the current database (including TOAST tables),
- the table OID, schema and table name, number of disk
- blocks read from that table, number of buffer hits, numbers of
- disk blocks read and buffer hits in all indexes of that table,
- numbers of disk blocks read and buffer hits from that table's
- auxiliary TOAST table (if any), and numbers of disk blocks read
- and buffer hits for the TOAST table's index.
+ <entry>
+ One row for each table in the current database (including TOAST
+ tables) with information about I/O on this specific table.
+ See <xref linkend="pg-statio-all-tables-view"> for more details.
</entry>
</row>
<row>
<entry><structname>pg_statio_all_indexes</><indexterm><primary>pg_statio_all_indexes</primary></indexterm></entry>
- <entry>For each index in the current database,
- the table and index OID, schema, table and index name,
- numbers of disk blocks read and buffer hits in that index.
+ <entry>
+ One row for each index in the current database
+ with information about I/O on this specific index.
+ See <xref linkend="pg-statio-all-indexes-view"> for more details.
</entry>
</row>
<row>
<entry><structname>pg_statio_all_sequences</><indexterm><primary>pg_statio_all_sequences</primary></indexterm></entry>
- <entry>For each sequence object in the current database,
- the sequence OID, schema and sequence name,
- numbers of disk blocks read and buffer hits in that sequence.
- </entry>
+ <entry>
+ One row for each sequence in the current database
+ with information about I/O on this specific sequence.
+ See <xref linkend="pg-statio-all-sequences-view"> for more details.
+ </entry>
</row>
<row>
<row>
<entry><structname>pg_stat_user_functions</><indexterm><primary>pg_stat_user_functions</primary></indexterm></entry>
- <entry>For all tracked functions, function OID, schema, name, number
- of calls, total time, and self time. Self time is the
- amount of time spent in the function itself, total time includes the
- time spent in functions it called. Time values are in milliseconds.
- </entry>
+ <entry>
+ One row for each tracked function (as specified by the
+ <xref linkend="guc-track-functions"> parameter). See
+ <xref linkend="pg-stat-user-functions-view"> for more details.
+ </entry>
</row>
<row>
</tgroup>
</table>
+ <para>
+ The <structname>pg_stat_activity</structname> view will have one row
+ per server process, showing information related to each connection to
+ the server.
+ </para>
+
+ <table id="pg-stat-bgwriter-view" xreflabel="pg_stat_bgwriter">
+ <title>pg_stat_bgwriter view</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>checkpoints_timed</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of scheduled checkpoints</entry>
+ </row>
+ <row>
+ <entry>checkpoints_requested</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of requested checkpoints</entry>
+ </row>
+ <row>
+ <entry>buffers_checkpoint</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of buffers written during checkpoints</entry>
+ </row>
+ <row>
+ <entry>buffers_clean</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of buffers written by the background writer</entry>
+ </row>
+ <row>
+ <entry>maxwritten_clean</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of times the background writer stopped a cleaning
+ scan because it had written too many buffers</entry>
+ </row>
+ <row>
+ <entry>buffers_backend</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of buffers written directly by a backend</entry>
+ </row>
+ <row>
+ <entry>buffers_backend_fsync</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of times a backend had to execute its own fsync
+ call (normally the background writer handles those even when the
+ backend does its own write)</entry>
+ </row>
+ <row>
+ <entry>buffers_alloc</entry>
+ <entry><type>bigint</type></entry>
+ <entry>Number of buffers allocated</entry>
+ </row>
+ <row>
+ <entry>stats_reset</entry>
+ <entry><type>bigint</type></entry>
+ <entry>The last time these statistics were reset</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_bgwriter</structname> view will always have a
+ single row with global data for the cluster.
+ </para>
+
+ <table id="pg-stat-database-view" xreflabel="pg_stat_database">
+ <title>pg_stat_database view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>datid</entry>
+ <entry><type>oid</></entry>
+ <entry>The oid of the database</entry>
+ </row>
+ <row>
+ <entry>datname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the database</entry>
+ </row>
+ <row>
+ <entry>numbackends</entry>
+ <entry><type>integer</></entry>
+ <entry>The number of backends currently connected to this database.
+ This is the only column in this view that returns a value for the
+ current state, all other columns return the accumulated values since
+ the last reset.</entry>
+ </row>
+ <row>
+ <entry>xact_commit</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of transactions in this database that has committed</entry>
+ </row>
+ <row>
+ <entry>xact_rollback</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of transactions in this database that has rolled back</entry>
+ </row>
+ <row>
+ <entry>blks_read</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of disk blocks read in this database</entry>
+ </row>
+ <row>
+ <entry>blks_hits</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of disk blocks read from the buffer cache
+ (this only includes hits in the PostgreSQL buffer cache, and not
+ the operating system filesystem cache)</entry>
+ </row>
+ <row>
+ <entry>tup_returned</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows returned by queries in this database</entry>
+ </row>
+ <row>
+ <entry>tup_fetched</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows fetched by queries in this database</entry>
+ </row>
+ <row>
+ <entry>tup_inserted</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows inserted by queries in this database</entry>
+ </row>
+ <row>
+ <entry>tup_updated</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows updated by queries in this database</entry>
+ </row>
+ <row>
+ <entry>tup_deleted</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows deleted by queries in this database</entry>
+ </row>
+ <row>
+ <entry>conflicts</entry>
+ <entry><type>bigint</></entry>
+ <entry>
+ The number of queries canceled due to conflict with recovery
+ (on standby servers) in this database. (See
+ <xref linkend="pg-stat-database-conflicts-view"> for more details)
+ </entry>
+ </row>
+ <row>
+ <entry>temp_files</entry>
+ <entry><type>bigint</></entry>
+ <entry>
+ The number of temporary files written by queries in the database.
+ All temporary files are counted, regardless of why the temporary file
+ was created (sorting or hash) or file size, and regardless of the
+ <xref linkend="guc-log-temp-files"> setting.
+ </entry>
+ </row>
+ <row>
+ <entry>temp_bytes</entry>
+ <entry><type>bigint</></entry>
+ <entry>
+ The amount of data written to temporary files by queries in
+ the database. All temporary files are counted, regardless of why
+ the temporary file was created (sorting or hash) or file size, and
+ regardless of the <xref linkend="guc-log-temp-files"> setting.
+ </entry>
+ </row>
+ <row>
+ <entry>deadlocks</entry>
+ <entry><type>bigint</></entry>
+ <entry>Number of deadlocks detected in the database</entry>
+ </row>
+ <row>
+ <entry>stats_reset</entry>
+ <entry><type>timestamptz</></entry>
+ <entry>The last time the statistics were reset</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_database</structname> view will contain one row
+ for each database in the cluster showing database wide statistics.
+ </para>
+
+ <table id="pg-stat-database-conflicts-view" xreflabel="pg_stat_database_conflicts">
+ <title>pg_stat_database_conflicts view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>datid</entry>
+ <entry><type>oid</></entry>
+ <entry>The oid of the database</entry>
+ </row>
+ <row>
+ <entry>datname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the database</entry>
+ </row>
+ <row>
+ <entry>confl_tablespace</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of queries that have been canceled due to
+ dropped tablespaces</entry>
+ </row>
+ <row>
+ <entry>confl_lock</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of queries that have been canceled due to
+ lock timeouts</entry>
+ </row>
+ <row>
+ <entry>confl_snapshot</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of queries that have been canceled due to
+ old snapshots</entry>
+ </row>
+ <row>
+ <entry>confl_bufferpin</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of queries that have been canceled due to
+ pinned buffers</entry>
+ </row>
+ <row>
+ <entry>confl_deadlock</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of queries that have been canceled due to
+ deadlocks</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_database_conflicts</structname> view will contain
+ 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.
+ </para>
+
+ <table id="pg-stat-replication-view" xreflabel="pg_stat_replication">
+ <title>pg_stat_replication view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>pid</entry>
+ <entry><type>integer</></entry>
+ <entry>The process id of the WAL sender process</entry>
+ </row>
+ <row>
+ <entry>usesysid</entry>
+ <entry><type>oid</></entry>
+ <entry>The oid of the user logged into this WAL sender process</entry>
+ </row>
+ <row>
+ <entry>usename</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the user logged into this WAL sender process</entry>
+ </row>
+ <row>
+ <entry>application_name</entry>
+ <entry><type>text</></entry>
+ <entry>The name of the application that has initiated the connection
+ to the WAL sender.</entry>
+ </row>
+ <row>
+ <entry>client_addr</entry>
+ <entry><type>inet</></entry>
+ <entry>The remote IP of the client connected to the WAL sender.
+ If this field is not set, it indicates that the client is
+ connected via a Unix socket on the server machine.
+ </entry>
+ </row>
+ <row>
+ <entry>client_hostname</entry>
+ <entry><type>text</></entry>
+ <entry>
+ If available, the hostname of the client as reported by a
+ reverse lookup of <structfield>client_addr</>. This field will
+ only be set when <xref linkend="guc-log-hostname"> is enabled.
+ </entry>
+ </row>
+ <row>
+ <entry>client_port</entry>
+ <entry><type>integer</></entry>
+ <entry>
+ The remote TCP port that the client is using for communication
+ to the , or <symbol>NULL</> if a unix socket is used.
+ </entry>
+ </row>
+ <row>
+ <entry>backend_start</entry>
+ <entry><type>timestamp with time zone</></entry>
+ <entry>
+ The time when this process was started, i.e. when the
+ client connected to the WAL sender.
+ </entry>
+ </row>
+ <row>
+ <entry>state</entry>
+ <entry><type>text</></entry>
+ <entry>Current WAL sender state</entry>
+ </row>
+ <row>
+ <entry>sent_location</entry>
+ <entry><type>text</></entry>
+ <entry>Last transaction log position sent on this connection</entry>
+ </row>
+ <row>
+ <entry>write_location</entry>
+ <entry><type>text</></entry>
+ <entry>Last transaction log position written to disk by the slave</entry>
+ </row>
+ <row>
+ <entry>flush_location</entry>
+ <entry><type>text</></entry>
+ <entry>Last transaction log position flushed to disk by the slave</entry>
+ </row>
+ <row>
+ <entry>replay_location</entry>
+ <entry><type>text</></entry>
+ <entry>Last transaction log position replayed into the database on the slave</entry>
+ </row>
+ <row>
+ <entry>sync_priority</entry>
+ <entry><type>int</></entry>
+ <entry>
+ The priority in the order which this slave will be picked as
+ the synchronous standby.
+ </entry>
+ </row>
+ <row>
+ <entry>sync_state</entry>
+ <entry><type>text</></entry>
+ <entry>
+ The synchronous state of this slave.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_replication</structname> view will contain one row
+ per WAL sender process, showing statistics about the replication to this
+ slave. Only directly connected standbys are listed; no information about
+ downstream standby servers is recorded.
+ </para>
+
+ <table id="pg-stat-all-tables-view" xreflabel="pg_stat_all_tables">
+ <title>pg_stat_all_tables view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>relid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the table this row</entry>
+ </row>
+ <row>
+ <entry>schemaname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the schema that the table is in</entry>
+ </row>
+ <row>
+ <entry>relname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the table</entry>
+ </row>
+ <row>
+ <entry>seq_scan</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of sequential scans initiated on this table</entry>
+ </row>
+ <row>
+ <entry>seq_tup_read</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of live rows fetch by sequential scans</entry>
+ </row>
+ <row>
+ <entry>idx_scan</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of index scans initiated on this table</entry>
+ </row>
+ <row>
+ <entry>idx_tup_fetch</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of live rows fetch by index scans</entry>
+ </row>
+ <row>
+ <entry>n_tup_ins</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows inserted</entry>
+ </row>
+ <row>
+ <entry>n_tup_upd</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows updated</entry>
+ </row>
+ <row>
+ <entry>n_tup_del</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows deleted</entry>
+ </row>
+ <row>
+ <entry>n_tup_hot_upd</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of rows HOT (i.e., no separate index update) updated</entry>
+ </row>
+ <row>
+ <entry>n_live_tup</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of live rows</entry>
+ </row>
+ <row>
+ <entry>n_dead_tup</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of dead rows</entry>
+ </row>
+ <row>
+ <entry>last_vacuum</entry>
+ <entry><type>timestamp with time zone</></entry>
+ <entry>The last time the table was manually non-<option>FULL</> vacuumed</entry>
+ </row>
+ <row>
+ <entry>last_autovacuum</entry>
+ <entry><type>timestamp with time zone</></entry>
+ <entry>The last time the table was vacuumed by the autovacuum daemon</entry>
+ </row>
+ <row>
+ <entry>last_analyze</entry>
+ <entry><type>timestamp with time zone</></entry>
+ <entry>The last time the table was manually analyzed</entry>
+ </row>
+ <row>
+ <entry>last_autoanalyze</entry>
+ <entry><type>timestamp with time zone</></entry>
+ <entry>The last time the table was analyzed by the autovacuum daemon</entry>
+ </row>
+ <row>
+ <entry>vacuum_count</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of times this table has been manually non-<option>FULL</> vacuumed</entry>
+ </row>
+ <row>
+ <entry>autovacuum_count</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of times this table has been vacuumed by the autovacuum daemon</entry>
+ </row>
+ <row>
+ <entry>analyze_count</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of times this table has been manually analyzed</entry>
+ </row>
+ <row>
+ <entry>autoanalyze_count</entry>
+ <entry><type>bigint</></entry>
+ <entry>The number of times this table has been analyzed by the autovacuum daemon</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_all_tables</structname> view will contain
+ one row for each table in the current database (including TOAST
+ tables) with information about accesses to this specific table. The
+ <structname>pg_stat_user_tables</structname> and
+ <structname>pg_stat_sys_tables</structname> contain the same information,
+ but filtered to only have rows for user and system tables.
+ </para>
+
+ <table id="pg-stat-all-indexes-view" xreflabel="pg_stat_all_indexes">
+ <title>pg_stat_all_indexes view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>relid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the table for this index</entry>
+ </row>
+ <row>
+ <entry>indexrelid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the index</entry>
+ </row>
+ <row>
+ <entry>schemaname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the schema the index is in</entry>
+ </row>
+ <row>
+ <entry>relname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the table for this index</entry>
+ </row>
+ <row>
+ <entry>indexrelname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the index</entry>
+ </row>
+ <row>
+ <entry>idx_scan</entry>
+ <entry><type>bigint</></entry>
+ <entry>Number of index scans initiated on this index</entry>
+ </row>
+ <row>
+ <entry>idx_tup_read</entry>
+ <entry><type>bigint</></entry>
+ <entry>Number of index entries returned by scans on this index</entry>
+ </row>
+ <row>
+ <entry>idx_tup_fetch</entry>
+ <entry><type>bigint</></entry>
+ <entry>Number of live table rows fetched by simple index scans using this index</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_all_indexes</structname> view will contain
+ one row for each index in the current database
+ with information about accesses to this specific index. The
+ <structname>pg_stat_user_indexes</structname> and
+ <structname>pg_stat_sys_indexes</structname> contain the same information,
+ but filtered to only have rows for user and system indexes.
+ </para>
+
+ <table id="pg-statio-all-tables-view" xreflabel="pg_statio_all_tables">
+ <title>pg_statio_all_tables view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>relid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the table</entry>
+ </row>
+ <row>
+ <entry>schemaname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the schema that the table is in</entry>
+ </row>
+ <row>
+ <entry>relname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the table</entry>
+ </row>
+ <row>
+ <entry>heap_blks_read</entry>
+ <entry><type>name</></entry>
+ <entry>Number of disk blocks read from this table</entry>
+ </row>
+ <row>
+ <entry>heap_blks_hit</entry>
+ <entry><type>name</></entry>
+ <entry>Number of buffer hits in this table</entry>
+ </row>
+ <row>
+ <entry>idx_blks_read</entry>
+ <entry><type>name</></entry>
+ <entry>Number of disk blocks read from all indexes on this table</entry>
+ </row>
+ <row>
+ <entry>idx_blks_hit</entry>
+ <entry><type>name</></entry>
+ <entry>Number of buffer hits in all indexes of this table</entry>
+ </row>
+ <row>
+ <entry>toast_blks_read</entry>
+ <entry><type>name</></entry>
+ <entry>Number of disk blocks read from this table's TOAST table (if any)</entry>
+ </row>
+ <row>
+ <entry>toast_blks_hit</entry>
+ <entry><type>name</></entry>
+ <entry>Number of buffer hits in this table's TOAST table (if any)</entry>
+ </row>
+ <row>
+ <entry>tidx_blks_read</entry>
+ <entry><type>name</></entry>
+ <entry>Number of disk blocks read from this table's TOAST table index (if any)</entry>
+ </row>
+ <row>
+ <entry>tidx_blks_hit</entry>
+ <entry><type>name</></entry>
+ <entry>Number of buffer hits in this table's TOAST table index (if any)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_statio_all_tables</structname> view will contain
+ one row for each table in the current database (including TOAST
+ tables) with information about I/O on this specific table. The
+ <structname>pg_statio_user_tables</structname> and
+ <structname>pg_statio_sys_tables</structname> contain the same information,
+ but filtered to only have rows for user and system tables.
+ </para>
+
+ <table id="pg-statio-all-indexes-view" xreflabel="pg_statio_all_indexes">
+ <title>pg_statio_all_indexes view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>relid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the table for this index</entry>
+ </row>
+ <row>
+ <entry>indexrelid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the index</entry>
+ </row>
+ <row>
+ <entry>schemaname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the schema the index is in</entry>
+ </row>
+ <row>
+ <entry>relname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the table for this index</entry>
+ </row>
+ <row>
+ <entry>indexrelname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the index</entry>
+ </row>
+ <row>
+ <entry>idx_blks_read</entry>
+ <entry><type>name</></entry>
+ <entry>Number of disk blocks read from the index</entry>
+ </row>
+ <row>
+ <entry>idx_blks_hit</entry>
+ <entry><type>name</></entry>
+ <entry>Number of buffer hits in the index</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_statio_all_indexes</structname> view will contain
+ one row for each index in the current database
+ with information about I/O on this specific index. The
+ <structname>pg_statio_user_indexes</structname> and
+ <structname>pg_statio_sys_indexes</structname> contain the same information,
+ but filtered to only have rows for user and system indexes.
+ </para>
+
+ <table id="pg-statio-all-sequences-view" xreflabel="pg_statio_all_sequences">
+ <title>pg_statio_all_sequences view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>relid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the sequence</entry>
+ </row>
+ <row>
+ <entry>schemaname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the schema the sequence is in</entry>
+ </row>
+ <row>
+ <entry>relname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the sequence</entry>
+ </row>
+ <row>
+ <entry>blks_read</entry>
+ <entry><type>name</></entry>
+ <entry>Number of disk blocks read from the sequence</entry>
+ </row>
+ <row>
+ <entry>blks_hit</entry>
+ <entry><type>name</></entry>
+ <entry>Number of buffer hits in the sequence</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_statio_all_indexes</structname> view will contain
+ one row for each sequence in the current database
+ with information about I/O on this specific sequence.
+ </para>
+
+ <table id="pg-stat-user-functions-view" xreflabel="pg_stat_user_functions">
+ <title>pg_stat_user_functions view</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Column</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>funcid</entry>
+ <entry><type>oid</></entry>
+ <entry>The OID of the function</entry>
+ </row>
+ <row>
+ <entry>schemaname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the schema the function is in</entry>
+ </row>
+ <row>
+ <entry>funcname</entry>
+ <entry><type>name</></entry>
+ <entry>The name of the function</entry>
+ </row>
+ <row>
+ <entry>calls</entry>
+ <entry><type>bigint</></entry>
+ <entry>Number of times the function has been called</entry>
+ </row>
+ <row>
+ <entry>total_time</entry>
+ <entry><type>bigint</></entry>
+ <entry>Total time spent in this functions and all other functions
+ called by it, in milliseconds.</entry>
+ </row>
+ <row>
+ <entry>self_time</entry>
+ <entry><type>bigint</></entry>
+ <entry>Total time spent in this functions itself but not including
+ other functions called by it, in milliseconds.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ The <structname>pg_stat_user_functions</structname> view will contain
+ one row for each tracked function (as specified by the
+ <xref linkend="guc-track-functions"> parameter).
+ </para>
+
<sect3 id="monitoring-stats-functions">
<title>Statistics Access Functions</title>