0001-doc-explain-pgstatindex-fragmentation.patch

text/x-patch

Filename: 0001-doc-explain-pgstatindex-fragmentation.patch
Type: text/x-patch
Part: 0
Message: doc: explain pgstatindex fragmentation

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch 0001
Subject: doc: explain pgstatindex fragmentation
File+
doc/src/sgml/pgstattuple.sgml 8 0
From 5c82c207776fb8cde2357081b8579ba6db195c06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Yhuel?= <frederic.yhuel@dalibo.com>
Date: Tue, 5 Nov 2024 17:59:44 +0100
Subject: [PATCH] doc: explain pgstatindex fragmentation

It was quite hard to guess what leaf_fragmentation meant without looking
at pgstattuple's code. This patch aims to give to the user a better
idea of what it means.
---
 doc/src/sgml/pgstattuple.sgml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/src/sgml/pgstattuple.sgml b/doc/src/sgml/pgstattuple.sgml
index 4071da4ed9..8908b56663 100644
--- a/doc/src/sgml/pgstattuple.sgml
+++ b/doc/src/sgml/pgstattuple.sgml
@@ -277,6 +277,14 @@ leaf_fragmentation | 0
      page-by-page, and should not be expected to represent an
      instantaneous snapshot of the whole index.
     </para>
+
+    <para>
+     <literal>avg_leaf_density</literal> can be seen as the inverse of bloat,
+     while <literal>leaf_fragmentation</literal> represents a measure of disorder.
+     The higher <literal>leaf_fragmentation</literal> is, the less the physical
+     order of the index leaf pages corresponds to the logical order we would have
+     just after a <command>REINDEX</command>.
+    </para>
     </listitem>
    </varlistentry>
 
-- 
2.39.5