public inbox for [email protected]  
help / color / mirror / Atom feed
From: [email protected] <[email protected]>
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: [DOC] pg_stat_replication_slots representation style inconsisitant
Date: Fri, 30 Apr 2021 03:23:28 +0000
Message-ID: <OS0PR01MB61134DACFEF171067FCB7231FB5E9@OS0PR01MB6113.jpnprd01.prod.outlook.com> (raw)

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



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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [DOC] pg_stat_replication_slots representation style inconsisitant
  In-Reply-To: <OS0PR01MB61134DACFEF171067FCB7231FB5E9@OS0PR01MB6113.jpnprd01.prod.outlook.com>

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

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