Skip site navigation (1) Skip section navigation (2)

Pgstatindex and leaf fragmentation.

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Pgstatindex and leaf fragmentation.
Date: 2010-12-16 20:49:20
Message-ID: 4D0A7B50.6070201@vmsinfo.com (view raw or flat)
Thread:
Lists: 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




Responses

pgsql-novice by date

Next:From: YAMAMOTO TakashiDate: 2010-12-17 04:48:28
Subject: pg_largeobject and toast
Previous:From: Dara OlsonDate: 2010-12-16 16:58:20
Subject: Re: create function and trigger to update column on table update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group