Re: patternsel() and histogram_selectivity() and the hard cutoff of 100 - Mailing list pgsql-hackers

From Matteo Beccati
Subject Re: patternsel() and histogram_selectivity() and the hard cutoff of 100
Date
Msg-id 47B15B91.2080104@beccati.com
Whole thread Raw
In response to Re: patternsel() and histogram_selectivity() and the hard cutoff of 100  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Hi Greg,

>> So I had a thought about how to soften the controversial hard cutoff of 100
>> for the use of the histogram selectivity. Instead of switching 100% one way or
>> the other between the two heuristics why not calculate both and combine them.
>> The larger the sample size from the histogram the more we can weight the
>> histogram calculation. The smaller the histogram size the more we weight the
>> heuristic.
>>
>> My first thought was to scale it linearly so we use 10% of the histogram
>> sample + 90% of the heuristic for default statistic sizes of 10 samples. That
>> degenerates to the status quo for 100 samples and up.
> 
> Incidentally I hacked up a patch to do this:

Sounds sensible to me, at least much more than a hardcoded magic number 
a few people know about...


Cheers

-- 
Matteo Beccati

Openads - http://www.openads.org


pgsql-hackers by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: use of alias
Next
From: Bruce Momjian
Date:
Subject: Re: Patch review