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

From Hannu Krosing
Subject Re: RFC: planner statistics in 7.2
Date
Msg-id 3AE44B1C.8060602@tm.ee
Whole thread Raw
In response to Re: RFC: planner statistics in 7.2  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Tom Lane wrote:

> Philip Warner <pjw@rhyme.com.au> writes:
> 
>> What I'm suggesting is that if you look at a random sample of index nodes,
>> you should be able to get a statistically valid estimate of the 'clumping'
>> of the data pointed to by the index. 
> 
> 
> And I'm saying that you don't actually have to look at the index in
> order to compute the very same estimate.  The only property of the index
> that matters is its sort order; if you assume you know the right sort
> order (and in practice there's usually only one interesting possibility
> for a column) then you can compute the correlation just by looking at
> the table.

This is more true for unique indexes than for non-unique ones unless 
our non-unique indexes are smart enough to insert equal index nodes in 
table order .

> Andreas correctly points out that this approach doesn't extend very well
> to multi-column or functional indexes, but I'm willing to punt on those
> for the time being ...

----------
Hannu



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: row name length
Next
From: Philip Warner
Date:
Subject: Re: RFC: planner statistics in 7.2