Re: pgstattuple extension for indexes

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstattuple extension for indexes
Date: 2006-08-17 03:55:28
Message-ID: 20060817123632.5F47.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi Nagayasu san and folks,
I have a question about pgstatindex.

Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp> wrote:

> Attached patch has been cleaned up,
> and modified to be able to work with CVS HEAD.

Index leaf pages are ordered just after REINDEX.
[1] [2] [3]
After full-split, they will be the following:
[1] [3] [5] [2] [4] [6]
because new pages are allocated at the end of the index file.

I think this condition should be regarded as full-fragmented,
but pgstatindex reports that the leaf_fragmentation is 50%.

Presently, fragmentation factor is computed as the code below:

if (opaque->btpo_next != P_NONE && opaque->btpo_next < blkno)
stat->fragments++;

But the method has the above problem. So I suggest to use whether
the right link points to the next adjacent page or not.

if (opaque->btpo_next != P_NONE && opaque->btpo_next != blkno + 1)
stat->fragments++;

Do you think which method is better? Or do you have other ideas?

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew T. O'Connor 2006-08-17 04:47:05 Re: [HACKERS] Adjust autovacuum naptime automatically
Previous Message Tom Dunstan 2006-08-17 02:47:22 Re: Enum proposal / design

Browse pgsql-patches by date

  From Date Subject
Next Message Matthew T. O'Connor 2006-08-17 04:47:05 Re: [HACKERS] Adjust autovacuum naptime automatically
Previous Message Alvaro Herrera 2006-08-17 02:33:50 Re: Adjust autovacuum naptime automatically