[SERVER-4671] prefer indexes with equality match on a unique key Created: 12/Jan/12 Updated: 11/Jul/16 Resolved: 10/Jan/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.5 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | hari.khalsa@10gen.com |
| Resolution: | Done | Votes: | 1 |
| Labels: | query_triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
The current 'optimal' index heuristic does not take index uniqueness into account, but if a query expresses a single complete key of a unique index we know the number of scanned docs can be at most 1 on the index and should choose that index unless matches are impossible on another index. |