postgresql/src/backend
Tom Lane 40608e7f94 When estimating the selectivity of an inequality "column > constant" or
"column < constant", and the comparison value is in the first or last
histogram bin or outside the histogram entirely, try to fetch the actual
column min or max value using an index scan (if there is an index on the
column).  If successful, replace the lower or upper histogram bound with
that value before carrying on with the estimate.  This limits the
estimation error caused by moving min/max values when the comparison
value is close to the min or max.  Per a complaint from Josh Berkus.

It is tempting to consider using this mechanism for mergejoinscansel as well,
but that would inject index fetches into main-line join estimation not just
endpoint cases.  I'm refraining from that until we can get a better handle
on the costs of doing this type of lookup.
2010-01-04 02:44:40 +00:00
..
access Dept of second thoughts: my first cut at supporting "x IS NOT NULL" btree 2010-01-03 05:39:08 +00:00
bootstrap Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
catalog Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
commands Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
executor When estimating the selectivity of an inequality "column > constant" or 2010-01-04 02:44:40 +00:00
foreign Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
lib Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
libpq Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
main Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
nodes Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
optimizer Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
parser Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
po Translation updates 2009-12-19 20:23:26 +00:00
port Silence compiler warning about printf format for HANDLE. 2010-01-04 01:06:21 +00:00
postmaster Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
regex Teach the regular expression functions to do case-insensitive matching and 2009-12-01 21:00:24 +00:00
rewrite Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
snowball Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
storage Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
tcop Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
tsearch When estimating the selectivity of an inequality "column > constant" or 2010-01-04 02:44:40 +00:00
utils When estimating the selectivity of an inequality "column > constant" or 2010-01-04 02:44:40 +00:00
common.mk Expand test coverage support to entire tree 2009-08-07 20:50:22 +00:00
Makefile Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
nls.mk Convert the core lexer and parser into fully reentrant code, by making use 2009-07-13 02:02:20 +00:00