mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Change patternsel() so that instead of switching from a pure
pattern-examination heuristic method to purely histogram-driven selectivity at histogram size 100, we compute both estimates and use a weighted average. The weight put on the heuristic estimate decreases linearly with histogram size, dropping to zero for 100 or more histogram entries. Likewise in ltreeparentsel(). After a patch by Greg Stark, though I reorganized the logic a bit to give the caller of histogram_selectivity() more control.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.43 2008/01/01 19:45:59 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.44 2008/03/09 00:32:09 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -112,7 +112,8 @@ extern double mcv_selectivity(VariableStatData *vardata, FmgrInfo *opproc,
|
||||
double *sumcommonp);
|
||||
extern double histogram_selectivity(VariableStatData *vardata, FmgrInfo *opproc,
|
||||
Datum constval, bool varonleft,
|
||||
int min_hist_size, int n_skip);
|
||||
int min_hist_size, int n_skip,
|
||||
int *hist_size);
|
||||
|
||||
extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt,
|
||||
Pattern_Type ptype,
|
||||
|
||||
Reference in New Issue
Block a user