public inbox for [email protected]help / color / mirror / Atom feed
[DOC] pg_stat_replication_slots representation style inconsisitant 6+ messages / 4 participants [nested] [flat]
* [DOC] pg_stat_replication_slots representation style inconsisitant @ 2021-04-30 03:23 [email protected] <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: [email protected] @ 2021-04-30 03:23 UTC (permalink / raw) To: [email protected] <[email protected]>; +Cc: [email protected] <[email protected]> Hi When reading the manual doc, I found an inconsistent representation style for the newly added pg_stat_prefetch_recovery view in PG14 at [1]. Same problem seems to be reported by Noriyoshi Shinoda who also proposed a patch to fix the problem at[2]. I tried to fix the problem in a way different than Noriyoshi Shinoda which I think is more consistent with the existing specific view introduction in the same page. Please take the attached patch as your reference. [1] https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-PG-STAT-SUBSCRIPTION [2] https://www.postgresql.org/message-id/TU4PR8401MB1152945E4FD45E99C3F52B94EE4F9%40TU4PR8401MB1152.NAM... Regards, Tang Attachments: [application/octet-stream] 0001-pg_stat_prefetch_recovery_doc.patch (8.7K, 2-0001-pg_stat_prefetch_recovery_doc.patch) download | inline diff: From f5d656b2ebda42b032284aa145d7320caf8b926d Mon Sep 17 00:00:00 2001 From: tanghy <[email protected]> Date: Fri, 30 Apr 2021 11:55:38 +0900 Subject: [PATCH] pg_stat_prefetch_recovery_doc diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 886e626be8..78dc526960 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -340,7 +340,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <row> <entry><structname>pg_stat_prefetch_recovery</structname><indexterm><primary>pg_stat_prefetch_recovery</primary></indexterm></entry> <entry>Only one row, showing statistics about blocks prefetched during recovery. - See <xref linkend="pg-stat-prefetch-recovery-view"/> for details. + See <link linkend="monitoring-pg-stat-prefetch-recovery-view"> + <structname>pg_stat_prefetch_recovery</structname></link> for details. </entry> </row> @@ -2935,90 +2936,137 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </sect2> - <sect2 id="monitoring-pg-stat-subscription"> - <title><structname>pg_stat_subscription</structname></title> + <sect2 id="monitoring-pg-stat-prefetch-recovery-view"> + <title><structname>pg_stat_prefetch_recovery</structname></title> <indexterm> - <primary>pg_stat_subscription</primary> + <primary>pg_stat_prefetch_recovery</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_prefetch_recovery</structname> view will contain only + one row. It is filled with nulls if recovery is not running or WAL + prefetching is not enabled. See <xref linkend="guc-recovery-prefetch"/> + for more information. The counters in this view are reset whenever the + <xref linkend="guc-recovery-prefetch"/>, + <xref linkend="guc-recovery-prefetch-fpw"/> or + <xref linkend="guc-maintenance-io-concurrency"/> setting is changed and + the server configuration is reloaded. </para> - <table id="pg-stat-prefetch-recovery-view" xreflabel="pg_stat_prefetch_recovery"> + <table id="pg-stat-prefetch-recovery" xreflabel="pg_stat_prefetch_recovery"> <title><structname>pg_stat_prefetch_recovery</structname> View</title> - <tgroup cols="3"> + <tgroup cols="1"> <thead> - <row> - <entry>Column</entry> - <entry>Type</entry> - <entry>Description</entry> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + Column Type + </para> + <para> + Description + </para></entry> </row> </thead> - <tbody> - <row> - <entry><structfield>prefetch</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks prefetched because they were not in the buffer pool</entry> - </row> - <row> - <entry><structfield>skip_hit</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because they were already in the buffer pool</entry> - </row> - <row> - <entry><structfield>skip_new</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because they were new (usually relation extension)</entry> - </row> - <row> - <entry><structfield>skip_fpw</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because a full page image was included in the WAL and <xref linkend="guc-recovery-prefetch-fpw"/> was set to <literal>off</literal></entry> - </row> - <row> - <entry><structfield>skip_seq</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because of repeated access</entry> - </row> - <row> - <entry><structfield>distance</structfield></entry> - <entry><type>integer</type></entry> - <entry>How far ahead of recovery the prefetcher is currently reading, in bytes</entry> - </row> - <row> - <entry><structfield>queue_depth</structfield></entry> - <entry><type>integer</type></entry> - <entry>How many prefetches have been initiated but are not yet known to have completed</entry> - </row> - <row> - <entry><structfield>avg_distance</structfield></entry> - <entry><type>float4</type></entry> - <entry>How far ahead of recovery the prefetcher is on average, while recovery is not idle</entry> - </row> - <row> - <entry><structfield>avg_queue_depth</structfield></entry> - <entry><type>float4</type></entry> - <entry>Average number of prefetches in flight while recovery is not idle</entry> - </row> + <tbody> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>prefetch</structfield> <type>bigint</type> + </para> + <para> + Number of blocks prefetched because they were not in the buffer pool + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_hit</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because they were already in the buffer pool + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_new</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because they were new (usually relation extension) + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_fpw</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because a full page image was included in the WAL and <xref linkend="guc-recovery-prefetch-fpw"/> was set to <literal>off</literal> + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_seq</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because of repeated access + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>distance</structfield> <type>integer</type> + </para> + <para> + How far ahead of recovery the prefetcher is currently reading, in bytes + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>queue_depth</structfield> <type>integer</type> + </para> + <para> + How many prefetches have been initiated but are not yet known to have completed + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>avg_distance</structfield> <type>float4</type> + </para> + <para> + How far ahead of recovery the prefetcher is on average, while recovery is not idle + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>avg_queue_depth</structfield> <type>float4</type> + </para> + <para> + Average number of prefetches in flight while recovery is not idle + </para></entry> + </row> </tbody> </tgroup> </table> + </sect2> + + <sect2 id="monitoring-pg-stat-subscription"> + <title><structname>pg_stat_subscription</structname></title> + + <indexterm> + <primary>pg_stat_subscription</primary> + </indexterm> + <para> - The <structname>pg_stat_prefetch_recovery</structname> view will contain only - one row. It is filled with nulls if recovery is not running or WAL - prefetching is not enabled. See <xref linkend="guc-recovery-prefetch"/> - for more information. The counters in this view are reset whenever the - <xref linkend="guc-recovery-prefetch"/>, - <xref linkend="guc-recovery-prefetch-fpw"/> or - <xref linkend="guc-maintenance-io-concurrency"/> setting is changed and - the server configuration is reloaded. + 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"> -- 2.30.0.windows.2 ^ permalink raw reply [nested|flat] 6+ messages in thread
* RE: [DOC] pg_stat_replication_slots representation style inconsisitant @ 2021-04-30 03:37 [email protected] <[email protected]> parent: [email protected] <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: [email protected] @ 2021-04-30 03:37 UTC (permalink / raw) To: [email protected] <[email protected]>; [email protected] <[email protected]>; +Cc: [email protected] <[email protected]> > When reading the manual doc, I found an inconsistent representation style for > the newly added pg_stat_prefetch_recovery view in PG14 at [1]. > Same problem seems to be reported by Noriyoshi Shinoda who also proposed > a patch to fix the problem at[2]. > I tried to fix the problem in a way different than Noriyoshi Shinoda which I think > is more consistent with the existing specific view introduction in the same > page. > Please take the attached patch as your reference. I noticed one more thing. It seems the column " stats_reset | timestamp with time zone " is not listed in the pg_stat_prefetch_recovery view. Should we add this column too ? Best regards, houzj ^ permalink raw reply [nested|flat] 6+ messages in thread
* RE: [DOC] pg_stat_replication_slots representation style inconsisitant @ 2021-04-30 03:48 [email protected] <[email protected]> parent: [email protected] <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: [email protected] @ 2021-04-30 03:48 UTC (permalink / raw) To: [email protected] <[email protected]>; [email protected] <[email protected]>; Thomas Munro <[email protected]>; +Cc: [email protected] <[email protected]> On Friday, April 30, 2021 12:38 PM, Hou, Zhijie/侯 志杰 <[email protected]> wrote >I noticed one more thing. >It seems the column " stats_reset | timestamp with time zone " is not listed in the pg_stat_prefetch_recovery view. >Should we add this column too ? Indeed, column added. Thanks. Regards, Tang Attachments: [application/octet-stream] 0001-pg_stat_prefetch_recovery_doc_v2.patch (9.2K, 2-0001-pg_stat_prefetch_recovery_doc_v2.patch) download | inline diff: From 48151fdeca78973b4c8f7c8042dffb1134c8c9e9 Mon Sep 17 00:00:00 2001 From: tanghy <[email protected]> Date: Fri, 30 Apr 2021 12:43:41 +0900 Subject: [PATCH] pg_stat_prefetch_recovery_doc_v2 diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 886e626be8..0d476787f3 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -340,7 +340,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <row> <entry><structname>pg_stat_prefetch_recovery</structname><indexterm><primary>pg_stat_prefetch_recovery</primary></indexterm></entry> <entry>Only one row, showing statistics about blocks prefetched during recovery. - See <xref linkend="pg-stat-prefetch-recovery-view"/> for details. + See <link linkend="monitoring-pg-stat-prefetch-recovery-view"> + <structname>pg_stat_prefetch_recovery</structname></link> for details. </entry> </row> @@ -2632,6 +2633,15 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </thead> <tbody> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>stats_reset</structfield> <type>timestamp with time zone</type> + </para> + <para> + Time at which these statistics were last reset + </para></entry> + </row> + <row> <entry role="catalog_table_entry"><para role="column_definition"> <structfield>slot_name</structfield> <type>text</type> @@ -2935,90 +2945,137 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </sect2> - <sect2 id="monitoring-pg-stat-subscription"> - <title><structname>pg_stat_subscription</structname></title> + <sect2 id="monitoring-pg-stat-prefetch-recovery-view"> + <title><structname>pg_stat_prefetch_recovery</structname></title> <indexterm> - <primary>pg_stat_subscription</primary> + <primary>pg_stat_prefetch_recovery</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_prefetch_recovery</structname> view will contain only + one row. It is filled with nulls if recovery is not running or WAL + prefetching is not enabled. See <xref linkend="guc-recovery-prefetch"/> + for more information. The counters in this view are reset whenever the + <xref linkend="guc-recovery-prefetch"/>, + <xref linkend="guc-recovery-prefetch-fpw"/> or + <xref linkend="guc-maintenance-io-concurrency"/> setting is changed and + the server configuration is reloaded. </para> - <table id="pg-stat-prefetch-recovery-view" xreflabel="pg_stat_prefetch_recovery"> + <table id="pg-stat-prefetch-recovery" xreflabel="pg_stat_prefetch_recovery"> <title><structname>pg_stat_prefetch_recovery</structname> View</title> - <tgroup cols="3"> + <tgroup cols="1"> <thead> - <row> - <entry>Column</entry> - <entry>Type</entry> - <entry>Description</entry> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + Column Type + </para> + <para> + Description + </para></entry> </row> </thead> - <tbody> - <row> - <entry><structfield>prefetch</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks prefetched because they were not in the buffer pool</entry> - </row> - <row> - <entry><structfield>skip_hit</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because they were already in the buffer pool</entry> - </row> - <row> - <entry><structfield>skip_new</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because they were new (usually relation extension)</entry> - </row> - <row> - <entry><structfield>skip_fpw</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because a full page image was included in the WAL and <xref linkend="guc-recovery-prefetch-fpw"/> was set to <literal>off</literal></entry> - </row> - <row> - <entry><structfield>skip_seq</structfield></entry> - <entry><type>bigint</type></entry> - <entry>Number of blocks not prefetched because of repeated access</entry> - </row> - <row> - <entry><structfield>distance</structfield></entry> - <entry><type>integer</type></entry> - <entry>How far ahead of recovery the prefetcher is currently reading, in bytes</entry> - </row> - <row> - <entry><structfield>queue_depth</structfield></entry> - <entry><type>integer</type></entry> - <entry>How many prefetches have been initiated but are not yet known to have completed</entry> - </row> - <row> - <entry><structfield>avg_distance</structfield></entry> - <entry><type>float4</type></entry> - <entry>How far ahead of recovery the prefetcher is on average, while recovery is not idle</entry> - </row> - <row> - <entry><structfield>avg_queue_depth</structfield></entry> - <entry><type>float4</type></entry> - <entry>Average number of prefetches in flight while recovery is not idle</entry> - </row> + <tbody> + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>prefetch</structfield> <type>bigint</type> + </para> + <para> + Number of blocks prefetched because they were not in the buffer pool + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_hit</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because they were already in the buffer pool + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_new</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because they were new (usually relation extension) + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_fpw</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because a full page image was included in the WAL and <xref linkend="guc-recovery-prefetch-fpw"/> was set to <literal>off</literal> + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>skip_seq</structfield> <type>bigint</type> + </para> + <para> + Number of blocks not prefetched because of repeated access + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>distance</structfield> <type>integer</type> + </para> + <para> + How far ahead of recovery the prefetcher is currently reading, in bytes + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>queue_depth</structfield> <type>integer</type> + </para> + <para> + How many prefetches have been initiated but are not yet known to have completed + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>avg_distance</structfield> <type>float4</type> + </para> + <para> + How far ahead of recovery the prefetcher is on average, while recovery is not idle + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>avg_queue_depth</structfield> <type>float4</type> + </para> + <para> + Average number of prefetches in flight while recovery is not idle + </para></entry> + </row> </tbody> </tgroup> </table> + </sect2> + + <sect2 id="monitoring-pg-stat-subscription"> + <title><structname>pg_stat_subscription</structname></title> + + <indexterm> + <primary>pg_stat_subscription</primary> + </indexterm> + <para> - The <structname>pg_stat_prefetch_recovery</structname> view will contain only - one row. It is filled with nulls if recovery is not running or WAL - prefetching is not enabled. See <xref linkend="guc-recovery-prefetch"/> - for more information. The counters in this view are reset whenever the - <xref linkend="guc-recovery-prefetch"/>, - <xref linkend="guc-recovery-prefetch-fpw"/> or - <xref linkend="guc-maintenance-io-concurrency"/> setting is changed and - the server configuration is reloaded. + 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"> -- 2.30.0.windows.2 ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [DOC] pg_stat_replication_slots representation style inconsisitant @ 2021-05-11 05:42 Michael Paquier <[email protected]> parent: [email protected] <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: Michael Paquier @ 2021-05-11 05:42 UTC (permalink / raw) To: [email protected] <[email protected]>; +Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; Thomas Munro <[email protected]>; [email protected] <[email protected]> On Fri, Apr 30, 2021 at 03:48:27AM +0000, [email protected] wrote: > Indeed, column added. Thanks. I was looking at this thread, and please note that there is no need to do anything here as the WAL prefetch has been reverted for now as of c2dc1934. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, 2-signature.asc) download ^ permalink raw reply [nested|flat] 6+ messages in thread
* RE: [DOC] pg_stat_replication_slots representation style inconsisitant @ 2021-05-11 12:49 [email protected] <[email protected]> parent: Michael Paquier <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: [email protected] @ 2021-05-11 12:49 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; Thomas Munro <[email protected]>; [email protected] <[email protected]> On Tuesday, May 11, 2021 2:42 PM, Michael Paquier <[email protected]> wrote: >I was looking at this thread, and please note that there is no need to >do anything here as the WAL prefetch has been reverted for now as of >c2dc1934. Thanks for the updating. Got it. Regards, Tang ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [DOC] pg_stat_replication_slots representation style inconsisitant @ 2021-05-12 02:45 Thomas Munro <[email protected]> parent: [email protected] <[email protected]> 0 siblings, 0 replies; 6+ messages in thread From: Thomas Munro @ 2021-05-12 02:45 UTC (permalink / raw) To: [email protected] <[email protected]>; +Cc: Michael Paquier <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]> On Wed, May 12, 2021 at 12:49 AM [email protected] <[email protected]> wrote: > On Tuesday, May 11, 2021 2:42 PM, Michael Paquier <[email protected]> wrote: > >I was looking at this thread, and please note that there is no need to > >do anything here as the WAL prefetch has been reverted for now as of > >c2dc1934. > > Thanks for the updating. Got it. Thanks for the feedback. I'll be re-proposing the feature for 15 and I've made a note about this thread. ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-05-12 02:45 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-04-30 03:23 [DOC] pg_stat_replication_slots representation style inconsisitant [email protected] <[email protected]> 2021-04-30 03:37 ` [email protected] <[email protected]> 2021-04-30 03:48 ` [email protected] <[email protected]> 2021-05-11 05:42 ` Michael Paquier <[email protected]> 2021-05-11 12:49 ` [email protected] <[email protected]> 2021-05-12 02:45 ` Thomas Munro <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox