Teach the planner to treat a partial unique index as proving a variable is
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Feb 2009 20:16:21 +0000 (20:16 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Feb 2009 20:16:21 +0000 (20:16 +0000)
commitce6e31de9c99430256468d059eb226ea7a267376
tree9aaa52d121cf80e3426405f981c0f46dfd14b68f
parent57b5984d241c00bb8362881a14cc566fbb4869e3
Teach the planner to treat a partial unique index as proving a variable is
unique for a particular query, if the index predicate is satisfied.  This
requires a bit of reordering of operations so that we check the predicates
before doing any selectivity estimates, but shouldn't really cause any
noticeable slowdown.  Per a comment from Michal Politowski.
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/util/plancat.c
src/backend/utils/adt/selfuncs.c