On Fri, Aug 23, 2019 at 12:27 PM Michael Paquier <mich...@paquier.xyz> wrote:
>
> On Fri, Aug 23, 2019 at 11:09:44AM +0900, Masahiko Sawada wrote:
> > While updating the doc I realized that
> > perhaps we should have the new section for heap and put the
> > descriptions of heap functions into it rather than having them as
> > general functions. If we need this change it is for PG12. I will
> > register only the new feature patch to the next Commit Fest.
>
> I agree with the new heap section, and your patch on that looks good.
> While on it, I have one suggestion: fsm_page_contents does not have an
> example of query.  Could we add one while on it?  An example
> consistent with the other function's examples:
> =# SELECT fsm_page_contents(get_raw_page('pg_class', 'fsm', 0));

Good idea. I've updated the doc update patch.


Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
diff --git a/doc/src/sgml/pageinspect.sgml b/doc/src/sgml/pageinspect.sgml
index 8d81f88..e1753aa 100644
--- a/doc/src/sgml/pageinspect.sgml
+++ b/doc/src/sgml/pageinspect.sgml
@@ -127,6 +127,55 @@ test=# SELECT page_checksum(get_raw_page('pg_class', 0), 0);
 
    <varlistentry>
     <term>
+     <function>fsm_page_contents(page bytea) returns text</function>
+     <indexterm>
+      <primary>fsm_page_contents</primary>
+     </indexterm>
+    </term>
+
+    <listitem>
+     <para>
+      <function>fsm_page_contents</function> shows the internal node structure
+      of a FSM page. The output is a multiline string, with one line per
+      node in the binary tree within the page. For example:
+<screen>
+test=# SELECT fsm_page_contents(get_raw_page('pg_class', 'fsm', 0));
+ fsm_page_contents
+-------------------
+ 0: 235           +
+ 1: 235           +
+ 3: 235           +
+ 7: 235           +
+ 15: 235          +
+ 31: 235          +
+ 63: 235          +
+ 127: 235         +
+ 255: 235         +
+ 511: 235         +
+ 1023: 235        +
+ 2047: 235        +
+ 4095: 235        +
+ fp_next_slot: 0  +
+</screen>
+      Only those nodes that are not zero are printed. The so-called "next"
+      pointer, which points to the next slot to be returned from the page,
+      is also printed.
+     </para>
+     <para>
+      See <filename>src/backend/storage/freespace/README</filename> for more
+      information on the structure of an FSM page.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+ </sect2>
+
+ <sect2>
+  <title>Heap Functions</title>
+
+  <variablelist>
+   <varlistentry>
+    <term>
      <function>heap_page_items(page bytea) returns setof record</function>
      <indexterm>
       <primary>heap_page_items</primary>
@@ -203,29 +252,6 @@ test=# SELECT * FROM heap_page_item_attrs(get_raw_page('pg_class', 0), 'pg_class
      </para>
     </listitem>
    </varlistentry>
-
-   <varlistentry>
-    <term>
-     <function>fsm_page_contents(page bytea) returns text</function>
-     <indexterm>
-      <primary>fsm_page_contents</primary>
-     </indexterm>
-    </term>
-
-    <listitem>
-     <para>
-      <function>fsm_page_contents</function> shows the internal node structure
-      of a FSM page. The output is a multiline string, with one line per
-      node in the binary tree within the page. Only those nodes that are not
-      zero are printed. The so-called "next" pointer, which points to the
-      next slot to be returned from the page, is also printed.
-     </para>
-     <para>
-      See <filename>src/backend/storage/freespace/README</filename> for more
-      information on the structure of an FSM page.
-     </para>
-    </listitem>
-   </varlistentry>
   </variablelist>
  </sect2>
 

Reply via email to