Pgstatindex and leaf fragmentation. - Mailing list pgsql-novice

From Mladen Gogala
Subject Pgstatindex and leaf fragmentation.
Date
Msg-id 4D0A7B50.6070201@vmsinfo.com
Whole thread Raw
Responses Re: Pgstatindex and leaf fragmentation.  (Mladen Gogala <mladen.gogala@vmsinfo.com>)
List pgsql-novice
There is a Postgres extension in the contrib directory, named
pgstattuple, which collects valuable statistics for tables and indexes.
One of the calculated numbers is called "leaf_fragmentation". How exactly
is id defined, does anybody have a formula or a simple explanation? Is it
related to the photosynthesis? Here is an example:

testtrack=# select * from pgstatindex('public.defects_pkey');
 version | tree_level | index_size | root_block_no | internal_pages |
leaf_pages | empty_pages | deleted_pages |
avg_leaf_density|leaf_fragmentation

------------+----------------+----------------+-----------------------+-------------------------+-----------------+---------------------+-----------------------+--------------------------+--------------------
           2 |              1 |     647168 |                     3
|                        0 |              78 |                   0
|                      0 |                  89.67 |                  0
(1 row)

What do numbers "leaf_density" and "leaf_fragmentation" mean? I googled
but was unable to come up with a decent explanation. I am looking for
the formula or, at least, a good heuristic explanation.

--

Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
http://www.vmsinfo.com
The Leader in Integrated Media Intelligence Solutions




pgsql-novice by date:

Previous
From: "Dara Olson"
Date:
Subject: Re: create function and trigger to update column on table update
Next
From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
Date:
Subject: pg_largeobject and toast