diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-08 22:41:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-08 22:41:38 +0000 |
commit | 422495d0da79d8a36d6f3700a96c6acddd3e1d50 (patch) | |
tree | 45c9358fb6fbafcc537915027358e6c35b9cd03a /src/backend/tcop/postgres.c | |
parent | 6f10eb21118f1ce72d4dd144c494749e25658d51 (diff) | |
download | postgresql-422495d0da79d8a36d6f3700a96c6acddd3e1d50.tar.gz postgresql-422495d0da79d8a36d6f3700a96c6acddd3e1d50.zip |
Modify prefix_selectivity() so that it will never estimate the selectivity
of the generated range condition var >= 'foo' AND var < 'fop' as being less
than what eqsel() would estimate for var = 'foo'. This is intuitively
reasonable and it gets rid of the need for some entirely ad-hoc coding we
formerly used to reject bogus estimates. The basic problem here is that
if the prefix is more than a few characters long, the two boundary values
are too close together to be distinguishable by comparison to the column
histogram, resulting in a selectivity estimate of zero, which is often
not very sane. Change motivated by an example from Peter Eisentraut.
Arguably this is a bug fix, but I'll refrain from back-patching it
for the moment.
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions