Re: Correlation in cost_index() - Mailing list pgsql-hackers

From Manfred Koizar
Subject Re: Correlation in cost_index()
Date
Msg-id gni7jv49el8hh6f0sq2ag5j7dadekj08gv@4ax.com
Whole thread Raw
In response to Re: Correlation in cost_index()  (Sean Chittenden <sean@chittenden.org>)
List pgsql-hackers
On Thu, 7 Aug 2003 13:44:19 -0700, Sean Chittenden
<sean@chittenden.org> wrote:
>> The indexCorrelation^2 algorithm was only a quick hack with no theory
>> behind it :-(.  I've wanted to find some better method to put in there,
>> but have not had any time to research the problem.
>
>Could we "quick hack" it to a geometric mean instead since a mean
>seemed to yield better results than indexCorrelation^2?

Linear interpolation on (1-indexCorrelation)^2 (algorithm 3 in
http://members.aon.at/pivot/pg/16-correlation-732.diff) is almost as
good as geometric interpolation (algorithm 4 in the patch, proposal 3
in this thread), and its computation is much cheaper because it does
not call exp() and log().  Download
http://members.aon.at/pivot/pg/cost_index.sxc and play around with
your own numbers to get a feeling.

(1-indexCorrelation)^2 suffers from the same lack of theory behind it
as indexCorrelation^2.  But the results look much more plausible.
Well, at least to me ;-)

ServusManfred


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: consistency check on SPI tuple count failed
Next
From: Stephan Szabo
Date:
Subject: Re: consistency check on SPI tuple count failed