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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-03-09 00:33:54
Message-ID: 25674.1205022834@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Gregory Stark" <stark(at)enterprisedb(dot)com> writes:
>> 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.

> Incidentally I hacked up a patch to do this:

Applied with revisions --- I thought it was better to let the caller of
histogram_selectivity make the decision about how to combine the
estimates, instead of hard-wiring the choice into that subroutine.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2008-03-09 02:30:57 Re: Google Summer of Code 2008
Previous Message Dave Cramer 2008-03-08 22:12:25 Re: Doubt in index scan code