From 2722bd10c1c4076df8bab63673a5034221631446 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 22 Oct 2026 04:17:46 +0000
Subject: [PATCH v1 2/5] Describe buffer access strategy types in the glossary

The glossary explains the purpose and mechanics of buffer access strategies, but
not the available strategy types.

Describe normal, bulkread, bulkwrite, and vacuum, including the kinds of
operations that use each ring-based strategy. Use the types in the places that
mentions the glossary.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by:
Discussion: https://postgr.es/m/
---
 doc/src/sgml/config.sgml             |  2 ++
 doc/src/sgml/glossary.sgml           | 49 ++++++++++++++++++++++++----
 doc/src/sgml/ref/analyze.sgml        |  3 +-
 doc/src/sgml/ref/vacuum.sgml         |  3 +-
 doc/src/sgml/ref/vacuumdb.sgml       |  1 +
 doc/src/sgml/tablesample-method.sgml |  2 +-
 6 files changed, 51 insertions(+), 9 deletions(-)
  16.7% doc/src/sgml/ref/
  83.2% doc/src/sgml/

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index f7db2995c3e..8852549e97b 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -2130,6 +2130,7 @@ include_dir 'conf.d'
       <listitem>
        <para>
         Specifies the size of the
+        <literal>vacuum</literal>
         <glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
         used by the <command>VACUUM</command> and <command>ANALYZE</command>
         commands.  A setting of <literal>0</literal> will allow the operation
@@ -10133,6 +10134,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
          When the failsafe is triggered, any cost-based delay that is
          in effect will no longer be applied, further non-essential
          maintenance tasks (such as index vacuuming) are bypassed, and any
+         <literal>vacuum</literal>
          <glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
          in use will be disabled resulting in <command>VACUUM</command> being
          free to make use of all of
diff --git a/doc/src/sgml/glossary.sgml b/doc/src/sgml/glossary.sgml
index d28a3729188..66413c838f6 100644
--- a/doc/src/sgml/glossary.sgml
+++ b/doc/src/sgml/glossary.sgml
@@ -329,12 +329,49 @@
      <glossterm linkend="glossary-wal">WAL</glossterm> to permanent storage.
     </para>
     <para>
-     Buffer Access Strategies are used for various operations such as
-     sequential scans of large tables, <command>VACUUM</command>,
-     <command>COPY</command>, <command>CREATE TABLE AS SELECT</command>,
-     <command>ALTER TABLE</command>, <command>CREATE DATABASE</command>,
-     <command>CREATE INDEX</command>, and <command>CLUSTER</command>.
-    </para>
+     The available strategies are:
+    </para>
+    <variablelist>
+     <varlistentry>
+      <term><literal>normal</literal></term>
+      <listitem>
+       <para>
+        Uses ordinary buffer replacement without a strategy ring.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><literal>bulkread</literal></term>
+      <listitem>
+       <para>
+        Uses a strategy ring for operations expected to read many pages with
+        little reuse, such as large sequential scans.  Reusing a limited set
+        of buffers reduces the displacement of unrelated cached data.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><literal>bulkwrite</literal></term>
+      <listitem>
+       <para>
+        Uses a strategy ring for operations that write many pages, such as
+        <command>COPY FROM</command> and
+        <command>CREATE TABLE AS SELECT</command>.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><literal>vacuum</literal></term>
+      <listitem>
+       <para>
+        Uses a strategy ring for maintenance operations such as
+        <command>VACUUM</command> and <command>ANALYZE</command>.  Its size can
+        be controlled with
+        <xref linkend="guc-vacuum-buffer-usage-limit"/>.
+       </para>
+      </listitem>
+     </varlistentry>
+    </variablelist>
    </glossdef>
   </glossentry>
 
diff --git a/doc/src/sgml/ref/analyze.sgml b/doc/src/sgml/ref/analyze.sgml
index d27c0d9e864..671c5cca8a4 100644
--- a/doc/src/sgml/ref/analyze.sgml
+++ b/doc/src/sgml/ref/analyze.sgml
@@ -94,10 +94,11 @@ ANALYZE [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] [ <r
     <listitem>
      <para>
       Specifies the
+      <literal>vacuum</literal>
       <glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
       ring buffer size for <command>ANALYZE</command>.  This size is used to
       calculate the number of shared buffers which will be reused as part of
-      this strategy.  <literal>0</literal> disables use of a
+      this strategy.  <literal>0</literal> disables use of a <literal>vacuum</literal>
       <literal>Buffer Access Strategy</literal>.   When this option is not
       specified, <command>ANALYZE</command> uses the value from
       <xref linkend="guc-vacuum-buffer-usage-limit"/>.  Higher settings can
diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml
index 3c85846df26..3e3f2d30ec9 100644
--- a/doc/src/sgml/ref/vacuum.sgml
+++ b/doc/src/sgml/ref/vacuum.sgml
@@ -314,10 +314,11 @@ VACUUM [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] [ <re
     <listitem>
      <para>
       Specifies the
+      <literal>vacuum</literal>
       <glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
       ring buffer size for <command>VACUUM</command>.  This size is used to
       calculate the number of shared buffers which will be reused as part of
-      this strategy.  <literal>0</literal> disables use of a
+      this strategy.  <literal>0</literal> disables use of a <literal>vacuum</literal>
       <literal>Buffer Access Strategy</literal>.  If <option>ANALYZE</option>
       is also specified, the <option>BUFFER_USAGE_LIMIT</option> value is used
       for both the vacuum and analyze stages.  This option can't be used with
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index 508c8dfa146..cabc816837c 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -136,6 +136,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Specifies the
+        <literal>vacuum</literal>
         <glossterm linkend="glossary-buffer-access-strategy">Buffer Access Strategy</glossterm>
         ring buffer size for a given invocation of <application>vacuumdb</application>.
         This size is used to calculate the number of shared buffers which will
diff --git a/doc/src/sgml/tablesample-method.sgml b/doc/src/sgml/tablesample-method.sgml
index c821941b71b..8465005a3d7 100644
--- a/doc/src/sgml/tablesample-method.sgml
+++ b/doc/src/sgml/tablesample-method.sgml
@@ -202,7 +202,7 @@ BeginSampleScan (SampleScanState *node,
    This function may adjust the fields <literal>node-&gt;use_bulkread</literal>
    and <literal>node-&gt;use_pagemode</literal>.
    If <literal>node-&gt;use_bulkread</literal> is <literal>true</literal>, which it is by
-   default, the scan will use a buffer access strategy that encourages
+   default, the scan will use a <literal>bulkread</literal> buffer access strategy that encourages
    recycling buffers after use.  It might be reasonable to set this
    to <literal>false</literal> if the scan will visit only a small fraction of the
    table's pages.
-- 
2.34.1

