1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

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 <frederic.yhuel@dalibo.com>
Author: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Benoit Lobréau <benoit.lobreau@dalibo.com>
Discussion: https://postgr.es/m/bf110561-f774-4957-a890-bb6fab6804e0%40dalibo.com
Discussion: https://postgr.es/m/4c5dee3a-8381-4e0f-b882-d1bd950e8972@dalibo.com
This commit is contained in:
Peter Eisentraut
2025-06-30 11:28:11 +02:00
parent 3431e3e4aa
commit 9601351146

View File

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