postgresql/src
Tom Lane 54d20024c1 Fix some problems with selectivity estimation for partial indexes.
First, genericcostestimate() was being way too liberal about including
partial-index conditions in its selectivity estimate, resulting in
substantial underestimates for situations such as an indexqual "x = 42"
used with an index on x "WHERE x >= 40 AND x < 50".  While the code is
intentionally set up to favor selecting partial indexes when available,
this was too much...

Second, choose_bitmap_and() was likewise easily fooled by cases of this
type, since it would similarly think that the partial index had selectivity
independent of the indexqual.

Fixed by using predicate_implied_by() rather than simple equality checks
to determine redundancy.  This is a good deal more expensive but I don't
see much alternative.  At least the extra cost is only paid when there's
actually a partial index under consideration.

Per report from Jeff Davis.  I'm not going to risk back-patching this,
though.
2007-03-21 22:18:12 +00:00
..
backend Fix some problems with selectivity estimation for partial indexes. 2007-03-21 22:18:12 +00:00
bin Changes pg_trigger and extend pg_rewrite in order to allow triggers and 2007-03-19 23:38:32 +00:00
include Add three new regexp functions: regexp_matches, regexp_split_to_array, 2007-03-20 05:45:00 +00:00
interfaces Fix ecpg/preproc makefile for parallel builds: parser.o must depend 2007-03-18 17:57:34 +00:00
makefiles Add $(CFLAGS) to the simplified build rule for .so libraries on Darwin. 2006-11-28 05:45:43 +00:00
pl Code cleanup for function prototypes: change two K&R-style prototypes 2007-03-18 05:36:50 +00:00
port Code cleanup for function prototypes: change two K&R-style prototypes 2007-03-18 05:36:50 +00:00
template Make --with-ldap build on Unixware, per Olivier Prenant. 2006-12-14 21:49:54 +00:00
test Fix some problems with selectivity estimation for partial indexes. 2007-03-21 22:18:12 +00:00
timezone Arrange to install a "posixrules" entry in our timezone database, so that 2007-03-14 17:38:06 +00:00
tools Add support for running regression tests on procedural languages 2007-03-21 16:21:40 +00:00
tutorial Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). 2007-02-27 23:48:10 +00:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Testing commit stuff 2006-07-10 15:50:02 +00:00
Makefile Remove remains of old depend target. 2007-01-20 17:16:17 +00:00
Makefile.global.in Replace useless uses of := by = in makefiles. 2007-02-09 15:56:00 +00:00
Makefile.shlib Change $(CC) to $(COMPILER) on Solaris gcc so -m64 is passed into the 2007-02-20 22:45:57 +00:00
nls-global.mk When merging PO files, take into consideration translations in other PO 2006-04-05 13:40:15 +00:00
win32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00