postgresql/src/test
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
..
bench Update CVS HEAD for 2007 copyright. Back branches are typically not 2007-01-05 22:20:05 +00:00
examples Wording cleanup for error messages. Also change can't -> cannot. 2007-02-01 19:10:30 +00:00
locale $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
mb Change the backend to reject strings containing invalidly-encoded multibyte 2006-05-21 20:05:21 +00:00
performance Add CVS tag lines to files that were lacking them. 2006-03-11 04:38:42 +00:00
regress Fix some problems with selectivity estimation for partial indexes. 2007-03-21 22:18:12 +00:00
thread Wording cleanup for error messages. Also change can't -> cannot. 2007-02-01 19:10:30 +00:00
Makefile $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00