Re: patternsel() and histogram_selectivity() and the hard cutoff of 100

From: Matteo Beccati <php(at)beccati(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patternsel() and histogram_selectivity() and the hard cutoff of 100
Date: 2008-02-12 08:40:49
Message-ID: 47B15B91.2080104@beccati.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-02-12 10:49:12 Re: Patch review
Previous Message Brendan Jurd 2008-02-12 05:59:22 Re: use of alias