Skip to content

Commit c51cba5

Browse files
laurenzCommitfest Bot
authored andcommitted
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/4c5dee3a-8381-4e0f-b882-d1bd950e8972@dalibo.com
1 parent fa638ed commit c51cba5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/src/sgml/pgstattuple.sgml

Lines changed: 9 additions & 0 deletions
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)