Re: pgstattuple extension for indexes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org, ishii(at)sraoss(dot)co(dot)jp
Subject: Re: pgstattuple extension for indexes
Date: 2006-07-06 02:18:20
Message-ID: 200607060218.k662IKq25483@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

ITAGAKI Takahiro wrote:
> This is an extension of pgstattuple to query information from indexes.
> It supports btree, hash and gist. Gin is not supported.
> It scans only index pages and does not read corresponding heap tuples.
> Therefore, 'dead_tuple' means the number of tuples with LP_DELETE flag.
>
> Also, I added an experimental feature for btree indexes. It checks
> fragmentation factor of indexes. If an leaf has the right link on the next
> adjacent page in the file, it is assumed to be continuous (not fragmented).
> It will help us to decide when to REINDEX.
>
> Suggestions welcome.
>
> ----
> $ pgbench -i
> $ pgbench -n -t 100 -c 10
> # select * from pgstattuple('accounts_pkey');
> NOTICE: 0.36% fragmented
> HINT: continuous=273, forward=1, backward=0
> -[ RECORD 1 ]------+--------
> table_len | 2260992
> tuple_count | 100996 -- 996 tuples are dead practically,
> tuple_len | 1615936 but no LP_DELETE yet.
> tuple_percent | 71.47
> dead_tuple_count | 4
> dead_tuple_len | 64 -- 64 tuples are marked as LP_DELETE.
> dead_tuple_percent | 0
> free_space | 208188
> free_percent | 9.21
> ----
>
>
> Regards,
> ---
> ITAGAKI Takahiro
> NTT Open Source Software Center

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gourish Singbal 2006-07-06 09:03:42 unsubscribe
Previous Message Greg Stark 2006-07-06 01:14:21 Re: Scan Keys

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2006-07-06 14:19:35 Re: Client build of MSVC6+ patch
Previous Message Bruce Momjian 2006-07-06 02:13:23 Re: Client build of MSVC6+ patch