Re: RFC: planner statistics in 7.2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: RFC: planner statistics in 7.2
Date
Msg-id 23742.987729281@sss.pgh.pa.us
Whole thread Raw
In response to Re: RFC: planner statistics in 7.2  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: RFC: planner statistics in 7.2  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> I'm not sure you want to know how well sorted it is in general, but you do
> want to know the expected cost in IOs of reading all records from a given
> index node, so you can more accurately estimate indexscan costs. AFAICS it
> does not require that the entire table be sorted. So checking the pointers
> on the index nodes gives an idea of clustering.

But you don't really need to look at the index (if it even exists
at the time you do the ANALYZE).  The extent to which the data is
ordered in the table is a property of the table, not the index.
I'd prefer to get the stat just from the table and not have to do
additional I/O to examine the indexes.

But, as I said, I'm still reading the literature about estimation
methods for indexscans.  It may turn out that a statistic calculated
this way isn't the right thing to use, or isn't trustworthy when taken
over a small sample.

>> Is that more standard than the other syntax?

> Not at all. It just avoids messing with one of the standard statements.

Oh, so you're deliberately not being standard.  I see.  Probably a
reasonable point.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Hulands
Date:
Subject: Including libpq++.h
Next
From: Tom Lane
Date:
Subject: Re: Including libpq++.h