Change patternsel() so that instead of switching from a pure
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/ltree/ltree_op.c | modified | +19 −8 |
| src/backend/utils/adt/selfuncs.c | modified | +53 −25 |
| src/include/utils/selfuncs.h | modified | +3 −2 |