Skip to content

Commit 91f57e4

Browse files
laurenzCommitfest Bot
authored and
Commitfest Bot
committed
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. Author: Frédéric Yhuel Author: Laurenz Albe Reviewed-by: Bertrand Drouvot, Benoît Lobréau Discussion: https://postgr.es/m/bf110561-f774-4957-a890-bb6fab6804e0%40dalibo.com Discussion: https://postgr.es/m/[email protected]
1 parent c061000 commit 91f57e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/src/sgml/pgstattuple.sgml

+9
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,15 @@ leaf_fragmentation | 0
270270
page than is accounted for by <literal>internal_pages + leaf_pages +
271271
empty_pages + deleted_pages</literal>, because it also includes the
272272
index's metapage.
273+
<literal>avg_leaf_density</literal> is the fraction of the index size that
274+
is taken up by user data. Since indexes have a default fillfactor of 90,
275+
this should be around 90 for newly built indexes of non-negligible size,
276+
but usually deteriorates over time.
277+
<literal>leaf_fragmentation</literal> represents a measure of disorder.
278+
A higher <literal>leaf_fragmentation</literal> indicates that the
279+
physical order of the index leaf pages increasingly deviates from their
280+
logical order. This can have a significant impact if a large part
281+
of the index is read from disk.
273282
</para>
274283

275284
<para>

0 commit comments

Comments
 (0)