postgresql/src/backend/optimizer/path
Tom Lane 26112850ec Fix OR-index-scan planner to recognize that a partial index is usable
for scanning one term of an OR clause if the index's predicate is implied
by that same OR clause term (possibly in conjunction with top-level WHERE
clauses).  Per recent example from Dawid Kuroczko,
http://archives.postgresql.org/pgsql-performance/2004-10/msg00095.php
Also, fix a very long-standing bug in index predicate testing, namely the
bizarre ordering of decomposition of predicate and restriction clauses.
AFAICS the correct way is to break down the predicate all the way, and
then for each component term see if you can prove it from the entire
restriction set.  The original coding had a purely-implementation-artifact
distinction between ANDing at the top level and ANDing below that, and
proceeded to get the decomposition order wrong everywhere below the top
level, with the result that even slightly complicated AND/OR predicates
could not be proven.  For instance, given
create index foop on foo(f2) where f1=42 or f1=1
    or (f1 = 11 and f2 = 55);
the old code would fail to match this index to the query
select * from foo where f1 = 11 and f2 = 55;
when it obviously ought to match.
2004-10-11 22:57:00 +00:00
..
Makefile $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
allpaths.c Clean up handling of inherited-table update queries, per bug report 2004-10-02 22:39:49 +00:00
clausesel.c Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
costsize.c Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
indxpath.c Fix OR-index-scan planner to recognize that a partial index is usable 2004-10-11 22:57:00 +00:00
joinpath.c Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
joinrels.c Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
orindxpath.c Fix OR-index-scan planner to recognize that a partial index is usable 2004-10-11 22:57:00 +00:00
pathkeys.c Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
tidpath.c Update copyright to 2004. 2004-08-29 04:13:13 +00:00