postgresql/src/backend
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
..
access Reverted waiting for further fixes: 2007-03-13 14:32:25 +00:00
bootstrap First phase of plan-invalidation project: create a plan cache management 2007-03-13 00:33:44 +00:00
catalog Add new columns for tuple statistics on a database level to 2007-03-16 17:57:36 +00:00
commands Changes pg_trigger and extend pg_rewrite in order to allow triggers and 2007-03-19 23:38:32 +00:00
executor SPI_cursor_open failed to enforce that only read-only queries could be 2007-03-17 03:15:38 +00:00
lib Add resetStringInfo(), which clears the content of a StringInfo, and 2007-03-03 19:32:55 +00:00
libpq Add lo_truncate() to backend and libpq for large object truncation. 2007-03-03 19:52:47 +00:00
main Cleanup the bootstrap code a little, and rename "dummy procs" in the code 2007-03-07 13:35:03 +00:00
nodes Fix up the remaining places where the expression node structure would lose 2007-03-17 00:11:05 +00:00
optimizer Fix some problems with selectivity estimation for partial indexes. 2007-03-21 22:18:12 +00:00
parser Changes pg_trigger and extend pg_rewrite in order to allow triggers and 2007-03-19 23:38:32 +00:00
po Translation updates 2006-12-02 01:16:16 +00:00
port Native shared memory implementation for win32. 2007-03-21 14:39:23 +00:00
postmaster Add new columns for tuple statistics on a database level to 2007-03-16 17:57:36 +00:00
regex Wording cleanup for error messages. Also change can't -> cannot. 2007-02-01 19:10:30 +00:00
rewrite Changes pg_trigger and extend pg_rewrite in order to allow triggers and 2007-03-19 23:38:32 +00:00
storage Cleanup the bootstrap code a little, and rename "dummy procs" in the code 2007-03-07 13:35:03 +00:00
tcop First phase of plan-invalidation project: create a plan cache management 2007-03-13 00:33:44 +00:00
utils Fix some problems with selectivity estimation for partial indexes. 2007-03-21 22:18:12 +00:00
Makefile Replace useless uses of := by = in makefiles. 2007-02-09 15:56:00 +00:00
nls.mk Add _ to gettext triggers. Must have been forgotten here when it was introduced. 2005-10-04 11:14:03 +00:00