Re: How much clustered?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Carlos Henrique Reimer <carlosreimer(at)yahoo(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How much clustered?
Date: 2006-02-16 15:37:40
Message-ID: 28416.1140104260@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Carlos Henrique Reimer <carlosreimer(at)yahoo(dot)com(dot)br> writes:
> I would like to know how much clustered is a table related to some index.... How can I discover?

You could do
select ctid from mytable order by indexcolumns
and then do whatever sort of calculation strikes your fancy on the
sequence of page numbers. (It's probably fair to ignore the row
numbers, considering an index to be fully clustered if the page
reference sequence is perfect.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chad 2006-02-16 15:41:09 How do I use the backend APIs
Previous Message Tom Lane 2006-02-16 15:33:44 Re: NULLs in unique indexes; Was: Oracle purchases Sleepycat - is this the "other shoe" for MySQL AB?