pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: descriptions of pg_stat_user_functions and pg_stat_slru
Date: Thu, 21 May 2020 03:26:27 +0900
Message-ID: <bd73f8fe-7a9f-d903-b84f-8410ba3e1d5f@oss.nttdata.com> (raw)
In-Reply-To: <19926.1589981558@sss.pgh.pa.us>
References: <6f8a482c-b3fa-4ed9-21c3-6d222a2cb87d@oss.nttdata.com>
	<23668.1589940341@sss.pgh.pa.us>
	<f31875d6-2300-87af-1479-c9d9abc013be@oss.nttdata.com>
	<19926.1589981558@sss.pgh.pa.us>



On 2020/05/20 22:32, Tom Lane wrote:
> Fujii Masao <masao.fujii@oss.nttdata.com> writes:
>> Also I don't like that all the stats views are packed in one section
>> currently. Which makes the docs difficult to read, I'm afraid. Thought?
>> If we change the layout entirely, at the same time, what about separating
>> each view into different section by adding <sect2>?
> 
> OK by me --- that, too, would be more like the existing catalogs
> chapter.

Yeah, so I'd like to propose the attached patch.

- 6644 | LWLock          | ProcArrayLock
+ 6644 | LWLock          | ProcArray

I found "ProcArrayLock" is still used in monitoring.sgml though
it was renamed to ProcArray. So the patch also includes the above change.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachments:

monitoring_docfix.patch (text/plain, 23.5K) download 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. </para> + </sect2> - <table id="pg-stat-activity-view" xreflabel="pg_stat_activity"> + <sect2 id="pg-stat-activity-view" xreflabel="pg_stat_activity"> + <title><structname>pg_stat_activity</structname></title> + + <indexterm> + <primary>pg_stat_activity</primary> + </indexterm> + + <para> + The <structname>pg_stat_activity</structname> view will have one row + per server process, showing information related to + the current activity of that process. + </para> + + <table> <title><structname>pg_stat_activity</structname> View</title> <tgroup cols="1"> <thead> @@ -889,12 +903,6 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser </tgroup> </table> - <para> - The <structname>pg_stat_activity</structname> view will have one row - per server process, showing information related to - the current activity of that process. - </para> - <note> <para> The <structfield>wait_event</structfield> and <structfield>state</structfield> columns are @@ -2135,15 +2143,31 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <programlisting> 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) </programlisting> </para> - <table id="pg-stat-replication-view" xreflabel="pg_stat_replication"> + </sect2> + + <sect2 id="pg-stat-replication-view" xreflabel="pg_stat_replication"> + <title><structname>pg_stat_replication</structname></title> + + <indexterm> + <primary>pg_stat_replication</primary> + </indexterm> + + <para> + The <structname>pg_stat_replication</structname> 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. + </para> + + <table> <title><structname>pg_stat_replication</structname> View</title> <tgroup cols="1"> <thead> @@ -2457,13 +2481,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> - <para> - The <structname>pg_stat_replication</structname> 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. - </para> - <para> The lag times reported in the <structname>pg_stat_replication</structname> 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 </para> </note> - <table id="pg-stat-wal-receiver-view" xreflabel="pg_stat_wal_receiver"> + </sect2> + + <sect2 id="pg-stat-wal-receiver-view" xreflabel="pg_stat_wal_receiver"> + <title><structname>pg_stat_wal_receiver</structname></title> + + <indexterm> + <primary>pg_stat_wal_receiver</primary> + </indexterm> + + <para> + The <structname>pg_stat_wal_receiver</structname> view will contain only + one row, showing statistics about the WAL receiver from that receiver's + connected server. + </para> + + <table> <title><structname>pg_stat_wal_receiver</structname> View</title> <tgroup cols="1"> <thead> @@ -2668,13 +2700,23 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-subscription" xreflabel="pg_stat_subscription"> + <title><structname>pg_stat_subscription</structname></title> + + <indexterm> + <primary>pg_stat_subscription</primary> + </indexterm> + <para> - The <structname>pg_stat_wal_receiver</structname> view will contain only - one row, showing statistics about the WAL receiver from that receiver's - connected server. + The <structname>pg_stat_subscription</structname> 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. </para> - <table id="pg-stat-subscription" xreflabel="pg_stat_subscription"> + <table> <title><structname>pg_stat_subscription</structname> View</title> <tgroup cols="1"> <thead> @@ -2776,14 +2818,25 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-ssl-view" xreflabel="pg_stat_ssl"> + <title><structname>pg_stat_ssl</structname></title> + + <indexterm> + <primary>pg_stat_ssl</primary> + </indexterm> + <para> - The <structname>pg_stat_subscription</structname> 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 <structname>pg_stat_ssl</structname> view will contain one row per + backend or WAL sender process, showing statistics about SSL usage on + this connection. It can be joined to <structname>pg_stat_activity</structname> + or <structname>pg_stat_replication</structname> on the + <structfield>pid</structfield> column to get more details about the + connection. </para> - <table id="pg-stat-ssl-view" xreflabel="pg_stat_ssl"> + <table> <title><structname>pg_stat_ssl</structname> View</title> <tgroup cols="1"> <thead> @@ -2896,16 +2949,25 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-gssapi-view" xreflabel="pg_stat_gssapi"> + <title><structname>pg_stat_gssapi</structname></title> + + <indexterm> + <primary>pg_stat_gssapi</primary> + </indexterm> + <para> - The <structname>pg_stat_ssl</structname> view will contain one row per - backend or WAL sender process, showing statistics about SSL usage on - this connection. It can be joined to <structname>pg_stat_activity</structname> - or <structname>pg_stat_replication</structname> on the + The <structname>pg_stat_gssapi</structname> view will contain one row per + backend, showing information about GSSAPI usage on this connection. It can + be joined to <structname>pg_stat_activity</structname> or + <structname>pg_stat_replication</structname> on the <structfield>pid</structfield> column to get more details about the connection. </para> - <table id="pg-stat-gssapi-view" xreflabel="pg_stat_gssapi"> + <table> <title><structname>pg_stat_gssapi</structname> View</title> <tgroup cols="1"> <thead> @@ -2962,17 +3024,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-archiver-view" xreflabel="pg_stat_archiver"> + <title><structname>pg_stat_archiver</structname></title> + + <indexterm> + <primary>pg_stat_archiver</primary> + </indexterm> + <para> - The <structname>pg_stat_gssapi</structname> view will contain one row per - backend, showing information about GSSAPI usage on this connection. It can - be joined to <structname>pg_stat_activity</structname> or - <structname>pg_stat_replication</structname> on the - <structfield>pid</structfield> column to get more details about the - connection. + The <structname>pg_stat_archiver</structname> view will always have a + single row, containing data about the archiver process of the cluster. </para> - - <table id="pg-stat-archiver-view" xreflabel="pg_stat_archiver"> + <table> <title><structname>pg_stat_archiver</structname> View</title> <tgroup cols="1"> <thead> @@ -3053,12 +3119,21 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-bgwriter-view" xreflabel="pg_stat_bgwriter"> + <title><structname>pg_stat_bgwriter</structname></title> + + <indexterm> + <primary>pg_stat_bgwriter</primary> + </indexterm> + <para> - The <structname>pg_stat_archiver</structname> view will always have a - single row, containing data about the archiver process of the cluster. + The <structname>pg_stat_bgwriter</structname> view will always have a + single row, containing global data for the cluster. </para> - <table id="pg-stat-bgwriter-view" xreflabel="pg_stat_bgwriter"> + <table> <title><structname>pg_stat_bgwriter</structname> View</title> <tgroup cols="1"> <thead> @@ -3181,12 +3256,22 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-database-view" xreflabel="pg_stat_database"> + <title><structname>pg_stat_database</structname></title> + + <indexterm> + <primary>pg_stat_database</primary> + </indexterm> + <para> - The <structname>pg_stat_bgwriter</structname> view will always have a - single row, containing global data for the cluster. + The <structname>pg_stat_database</structname> view will contain one row + for each database in the cluster, plus one for shared objects, showing + database-wide statistics. </para> - <table id="pg-stat-database-view" xreflabel="pg_stat_database"> + <table> <title><structname>pg_stat_database</structname> View</title> <tgroup cols="1"> <thead> @@ -3416,13 +3501,24 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-database-conflicts-view" xreflabel="pg_stat_database_conflicts"> + <title><structname>pg_stat_database_conflicts</structname></title> + + <indexterm> + <primary>pg_stat_database_conflicts</primary> + </indexterm> + <para> - The <structname>pg_stat_database</structname> view will contain one row - for each database in the cluster, plus one for shared objects, showing - database-wide statistics. + The <structname>pg_stat_database_conflicts</structname> 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. </para> - <table id="pg-stat-database-conflicts-view" xreflabel="pg_stat_database_conflicts"> + <table> <title><structname>pg_stat_database_conflicts</structname> View</title> <tgroup cols="1"> <thead> @@ -3508,15 +3604,26 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-all-tables-view" xreflabel="pg_stat_all_tables"> + <title><structname>pg_stat_all_tables</structname></title> + + <indexterm> + <primary>pg_stat_all_tables</primary> + </indexterm> + <para> - The <structname>pg_stat_database_conflicts</structname> 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 <structname>pg_stat_all_tables</structname> view will contain + one row for each table in the current database (including TOAST + tables), showing statistics about accesses to that specific table. The + <structname>pg_stat_user_tables</structname> and + <structname>pg_stat_sys_tables</structname> views + contain the same information, + but filtered to only show user and system tables respectively. </para> - <table id="pg-stat-all-tables-view" xreflabel="pg_stat_all_tables"> + <table> <title><structname>pg_stat_all_tables</structname> View</title> <tgroup cols="1"> <thead> @@ -3748,17 +3855,26 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-all-indexes-view" xreflabel="pg_stat_all_indexes"> + <title><structname>pg_stat_all_indexes</structname></title> + + <indexterm> + <primary>pg_stat_all_indexes</primary> + </indexterm> + <para> - The <structname>pg_stat_all_tables</structname> view will contain - one row for each table in the current database (including TOAST - tables), showing statistics about accesses to that specific table. The - <structname>pg_stat_user_tables</structname> and - <structname>pg_stat_sys_tables</structname> views + The <structname>pg_stat_all_indexes</structname> view will contain + one row for each index in the current database, + showing statistics about accesses to that specific index. The + <structname>pg_stat_user_indexes</structname> and + <structname>pg_stat_sys_indexes</structname> 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. </para> - <table id="pg-stat-all-indexes-view" xreflabel="pg_stat_all_indexes"> + <table> <title><structname>pg_stat_all_indexes</structname> View</title> <tgroup cols="1"> <thead> @@ -3849,16 +3965,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> - <para> - The <structname>pg_stat_all_indexes</structname> view will contain - one row for each index in the current database, - showing statistics about accesses to that specific index. The - <structname>pg_stat_user_indexes</structname> and - <structname>pg_stat_sys_indexes</structname> views - contain the same information, - but filtered to only show user and system indexes respectively. - </para> - <para> Indexes can be used by simple index scans, <quote>bitmap</quote> 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 </para> </note> - <table id="pg-statio-all-tables-view" xreflabel="pg_statio_all_tables"> + </sect2> + + <sect2 id="pg-statio-all-tables-view" xreflabel="pg_statio_all_tables"> + <title><structname>pg_statio_all_tables</structname></title> + + <indexterm> + <primary>pg_statio_all_tables</primary> + </indexterm> + + <para> + The <structname>pg_statio_all_tables</structname> 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 + <structname>pg_statio_user_tables</structname> and + <structname>pg_statio_sys_tables</structname> views + contain the same information, + but filtered to only show user and system tables respectively. + </para> + + <table> <title><structname>pg_statio_all_tables</structname> View</title> <tgroup cols="1"> <thead> @@ -4005,96 +4130,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </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), showing statistics about I/O on that specific table. The - <structname>pg_statio_user_tables</structname> and - <structname>pg_statio_sys_tables</structname> views - contain the same information, - but filtered to only show user and system tables respectively. - </para> + </sect2> - <table id="pg-statio-all-indexes-view" xreflabel="pg_statio_all_indexes"> - <title><structname>pg_statio_all_indexes</structname> View</title> - <tgroup cols="1"> - <thead> - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - Column Type - </para> - <para> - Description - </para></entry> - </row> - </thead> + <sect2 id="pg-statio-all-indexes-view" xreflabel="pg_statio_all_indexes"> + <title><structname>pg_statio_all_indexes</structname></title> - <tbody> - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>relid</structfield> <type>oid</type> - </para> - <para> - OID of the table for this index - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>indexrelid</structfield> <type>oid</type> - </para> - <para> - OID of this index - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>schemaname</structfield> <type>name</type> - </para> - <para> - Name of the schema this index is in - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>relname</structfield> <type>name</type> - </para> - <para> - Name of the table for this index - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>indexrelname</structfield> <type>name</type> - </para> - <para> - Name of this index - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>idx_blks_read</structfield> <type>bigint</type> - </para> - <para> - Number of disk blocks read from this index - </para></entry> - </row> - - <row> - <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>idx_blks_hit</structfield> <type>bigint</type> - </para> - <para> - Number of buffer hits in this index - </para></entry> - </row> - </tbody> - </tgroup> - </table> + <indexterm> + <primary>pg_statio_all_indexes</primary> + </indexterm> <para> The <structname>pg_statio_all_indexes</structname> 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. </para> - <table id="pg-statio-all-sequences-view" xreflabel="pg_statio_all_sequences"> + <table> + <title><structname>pg_statio_all_indexes</structname> View</title> + <tgroup cols="1"> + <thead> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + Column Type + </para> + <para> + Description + </para></entry> + </row> + </thead> + + <tbody> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>relid</structfield> <type>oid</type> + </para> + <para> + OID of the table for this index + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>indexrelid</structfield> <type>oid</type> + </para> + <para> + OID of this index + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>schemaname</structfield> <type>name</type> + </para> + <para> + Name of the schema this index is in + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>relname</structfield> <type>name</type> + </para> + <para> + Name of the table for this index + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>indexrelname</structfield> <type>name</type> + </para> + <para> + Name of this index + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>idx_blks_read</structfield> <type>bigint</type> + </para> + <para> + Number of disk blocks read from this index + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>idx_blks_hit</structfield> <type>bigint</type> + </para> + <para> + Number of buffer hits in this index + </para></entry> + </row> + </tbody> + </tgroup> + </table> + + </sect2> + + <sect2 id="pg-statio-all-sequences-view" xreflabel="pg_statio_all_sequences"> + <title><structname>pg_statio_all_sequences</structname></title> + + <indexterm> + <primary>pg_statio_all_sequences</primary> + </indexterm> + + <para> + The <structname>pg_statio_all_sequences</structname> view will contain + one row for each sequence in the current database, + showing statistics about I/O on that specific sequence. + </para> + + <table> <title><structname>pg_statio_all_sequences</structname> View</title> <tgroup cols="1"> <thead> @@ -4169,13 +4308,23 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-user-functions-view" xreflabel="pg_stat_user_functions"> + <title><structname>pg_stat_user_functions</structname></title> + + <indexterm> + <primary>pg_stat_user_functions</primary> + </indexterm> + <para> - The <structname>pg_statio_all_sequences</structname> view will contain - one row for each sequence in the current database, - showing statistics about I/O on that specific sequence. + The <structname>pg_stat_user_functions</structname> view will contain + one row for each tracked function, showing statistics about executions of + that function. The <xref linkend="guc-track-functions"/> parameter + controls exactly which functions are tracked. </para> - <table id="pg-stat-user-functions-view" xreflabel="pg_stat_user_functions"> + <table> <title><structname>pg_stat_user_functions</structname> View</title> <tgroup cols="1"> <thead> @@ -4249,10 +4398,19 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> + </sect2> + + <sect2 id="pg-stat-slru-view" xreflabel="pg_stat_slru"> + <title><structname>pg_stat_slru</structname></title> + <indexterm> <primary>SLRU</primary> </indexterm> + <indexterm> + <primary>pg_stat_slru</primary> + </indexterm> + <para> <productname>PostgreSQL</productname> accesses certain on-disk information via <firstterm>SLRU</firstterm> (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. </para> - <table id="pg-stat-slru-view" xreflabel="pg_stat_slru"> + <table> <title><structname>pg_stat_slru</structname> View</title> <tgroup cols="1"> <thead> @@ -4362,13 +4520,6 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </tgroup> </table> - <para> - The <structname>pg_stat_user_functions</structname> view will contain - one row for each tracked function, showing statistics about executions of - that function. The <xref linkend="guc-track-functions"/> parameter - controls exactly which functions are tracked. - </para> - </sect2> <sect2 id="monitoring-stats-functions">

view thread (10+ messages)  latest in thread

Message-ID: <bd73f8fe-7a9f-d903-b84f-8410ba3e1d5f@oss.nttdata.com>
Permalink:  ../bd73f8fe-7a9f-d903-b84f-8410ba3e1d5f@oss.nttdata.com/
Also on:    postgresql.org/message-id/bd73f8fe-7a9f-d903-b84f-8410ba3e1d5f@oss.nttdata.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, tgl@sss.pgh.pa.us, pgsql-docs@lists.postgresql.org
  Subject: Re: descriptions of pg_stat_user_functions and pg_stat_slru
  In-Reply-To: <bd73f8fe-7a9f-d903-b84f-8410ba3e1d5f@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox