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)
commit2071b38c4f39b1d07155ec7509cde740c4d5ed62
treebd362d5691a60f2be4f810861d98ce1b81eb41fe
parent422aaee32c2e674d997d08238b51892657b32981
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