Skip site navigation (1) Skip section navigation (2)

pgsql: Improve check_partial_indexes() to consider join clauses inproo

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve check_partial_indexes() to consider join clauses inproo
Date: 2012-11-16 00:29:24
Message-ID: E1TZ9oC-00030T-7m@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Improve check_partial_indexes() to consider join clauses in proof attempts.

Traditionally check_partial_indexes() has only looked at restriction
clauses while trying to prove partial indexes usable in queries.  However,
join clauses can also be used in some cases; mainly, that a strict operator
on "x" proves an "x IS NOT NULL" index predicate, even if the operator is
in a join clause rather than a restriction clause.  Adding this code fixes
a regression in 9.2, because previously we would take join clauses into
account when considering whether a partial index could be used in a
nestloop inner indexscan path.  9.2 doesn't handle nestloop inner
indexscans in the same way, and this consideration was overlooked in the
rewrite.  Moving the work to check_partial_indexes() is a better solution
anyway, since the proof applies whether or not we actually use the index
in that particular way, and we don't have to do it over again for each
possible outer relation.  Per report from Dave Cramer.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f0461cd8613830aa2448a38b09569e8c54cead5b

Modified Files
--------------
src/backend/optimizer/path/indxpath.c |   82 ++++++++++++++++++++++++++++++--
1 files changed, 76 insertions(+), 6 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-11-16 05:35:52
Subject: pgsql: Add -Wlogical-op to standard compiler flags, if supported
Previous:From: Peter EisentrautDate: 2012-11-15 05:06:12
Subject: pgsql: doc: Put commas in the right place on pg_restore reference page

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group