Teach the planner to treat a partial unique index as proving a variable is
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/allpaths.c | modified | +11 −5 |
| src/backend/optimizer/path/indxpath.c | modified | +10 −3 |
| src/backend/optimizer/path/orindxpath.c | modified | +2 −2 |
| src/backend/optimizer/util/plancat.c | modified | +7 −6 |
| src/backend/utils/adt/selfuncs.c | modified | +40 −23 |