From 94bc3b94f87ca3c7add0b3c81f7aa0a0103ca70d Mon Sep 17 00:00:00 2001
From: kommih <haribabuk@fast.au.fujitsu.com>
Date: Thu, 7 Feb 2019 16:13:56 +1100
Subject: [PATCH 3/5] Rename indexam.sgml to am.sgml

Reorganize am as both table and index

There is not much table access methods info.
---
 doc/src/sgml/{indexam.sgml => am.sgml} | 55 +++++++++++++++++---------
 doc/src/sgml/filelist.sgml             |  2 +-
 doc/src/sgml/postgres.sgml             |  2 +-
 doc/src/sgml/xindex.sgml               |  2 +-
 4 files changed, 40 insertions(+), 21 deletions(-)
 rename doc/src/sgml/{indexam.sgml => am.sgml} (97%)

diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/am.sgml
similarity index 97%
rename from doc/src/sgml/indexam.sgml
rename to doc/src/sgml/am.sgml
index 05102724ea..8d9edff622 100644
--- a/doc/src/sgml/indexam.sgml
+++ b/doc/src/sgml/am.sgml
@@ -1,16 +1,34 @@
-<!-- doc/src/sgml/indexam.sgml -->
+<!-- doc/src/sgml/am.sgml -->
 
-<chapter id="indexam">
- <title>Index Access Method Interface Definition</title>
+<chapter id="am">
+ <title>Access Method Interface Definition</title>
 
   <para>
    This chapter defines the interface between the core
-   <productname>PostgreSQL</productname> system and <firstterm>index access
-   methods</firstterm>, which manage individual index types.  The core system
-   knows nothing about indexes beyond what is specified here, so it is
-   possible to develop entirely new index types by writing add-on code.
+   <productname>PostgreSQL</productname> system and <firstterm>access
+   methods</firstterm>, which manage individual <literal>INDEX</literal>
+   and <literal>TABLE</literal> types.  The core system knows nothing
+   about these access methods beyond what is specified here, so it is
+   possible to develop entirely new access method types by writing add-on code.
   </para>
 
+ <sect1 id="table-access-methods">
+  <title>Overview of Table access methods </title>
+
+  <para>
+   All Tables in <productname>PostgreSQL</productname> are the primary
+   data store. Each table is stored as its own physical <firstterm>relation</firstterm>
+   and so is described by an entry in the <structname>pg_class</structname>
+   catalog. The table contents are entirely under the control of its
+   access method. (All the access methods furthermore use the standard page
+   layout described in <xref linkend="storage-page-layout"/>.)
+  </para>
+
+ </sect1>
+ 
+ <sect1 id="index-access-methods">
+  <title>Overview of Index access methods</title>
+
   <para>
    All indexes in <productname>PostgreSQL</productname> are what are known
    technically as <firstterm>secondary indexes</firstterm>; that is, the index is
@@ -43,7 +61,7 @@
    are reclaimed.
   </para>
 
- <sect1 id="index-api">
+ <sect2 id="index-api">
   <title>Basic API Structure for Indexes</title>
 
   <para>
@@ -217,9 +235,9 @@ typedef struct IndexAmRoutine
    conditions.
   </para>
 
- </sect1>
+ </sect2>
 
- <sect1 id="index-functions">
+ <sect2 id="index-functions">
   <title>Index Access Method Functions</title>
 
   <para>
@@ -710,9 +728,9 @@ amparallelrescan (IndexScanDesc scan);
    the beginning.
   </para>
 
- </sect1>
+ </sect2>
 
- <sect1 id="index-scanning">
+ <sect2 id="index-scanning">
   <title>Index Scanning</title>
 
   <para>
@@ -865,9 +883,9 @@ amparallelrescan (IndexScanDesc scan);
    if its internal implementation is unsuited to one API or the other.
   </para>
 
- </sect1>
+ </sect2>
 
- <sect1 id="index-locking">
+ <sect2 id="index-locking">
   <title>Index Locking Considerations</title>
 
   <para>
@@ -979,9 +997,9 @@ amparallelrescan (IndexScanDesc scan);
    reduce the frequency of such transaction cancellations.
   </para>
 
- </sect1>
+ </sect2>
 
- <sect1 id="index-unique-checks">
+ <sect2 id="index-unique-checks">
   <title>Index Uniqueness Checks</title>
 
   <para>
@@ -1128,9 +1146,9 @@ amparallelrescan (IndexScanDesc scan);
     </itemizedlist>
   </para>
 
- </sect1>
+ </sect2>
 
- <sect1 id="index-cost-estimation">
+ <sect2 id="index-cost-estimation">
   <title>Index Cost Estimation Functions</title>
 
   <para>
@@ -1377,5 +1395,6 @@ cost_qual_eval(&amp;index_qual_cost, path-&gt;indexquals, root);
    Examples of cost estimator functions can be found in
    <filename>src/backend/utils/adt/selfuncs.c</filename>.
   </para>
+ </sect2>
  </sect1>
 </chapter>
diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml
index a03ea1427b..52a5efca94 100644
--- a/doc/src/sgml/filelist.sgml
+++ b/doc/src/sgml/filelist.sgml
@@ -89,7 +89,7 @@
 <!ENTITY gin        SYSTEM "gin.sgml">
 <!ENTITY brin       SYSTEM "brin.sgml">
 <!ENTITY planstats    SYSTEM "planstats.sgml">
-<!ENTITY indexam    SYSTEM "indexam.sgml">
+<!ENTITY am         SYSTEM "am.sgml">
 <!ENTITY nls        SYSTEM "nls.sgml">
 <!ENTITY plhandler  SYSTEM "plhandler.sgml">
 <!ENTITY fdwhandler SYSTEM "fdwhandler.sgml">
diff --git a/doc/src/sgml/postgres.sgml b/doc/src/sgml/postgres.sgml
index 96d196d229..9dce0c5f81 100644
--- a/doc/src/sgml/postgres.sgml
+++ b/doc/src/sgml/postgres.sgml
@@ -250,7 +250,7 @@
   &tablesample-method;
   &custom-scan;
   &geqo;
-  &indexam;
+  &am;
   &generic-wal;
   &btree;
   &gist;
diff --git a/doc/src/sgml/xindex.sgml b/doc/src/sgml/xindex.sgml
index 9446f8b836..4fa821160c 100644
--- a/doc/src/sgml/xindex.sgml
+++ b/doc/src/sgml/xindex.sgml
@@ -36,7 +36,7 @@
    described in <classname>pg_am</classname>.  It is possible to add a
    new index access method by writing the necessary code and
    then creating an entry in <classname>pg_am</classname> &mdash; but that is
-   beyond the scope of this chapter (see <xref linkend="indexam"/>).
+   beyond the scope of this chapter (see <xref linkend="am"/>).
   </para>
 
   <para>
-- 
2.20.1.windows.1

