[MDEV-5663] Unique indexes not used in JOINs / lacking DOCs Created: 2014-02-12 Updated: 2014-02-12 Resolved: 2014-02-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.33a |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Slawomir Pryczek | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian-70-wheezy, 2xHDD in RAID1, 16GB Memory |
||
| Description |
|
Considering following table that isn't changing:
And another table we're trying to optimize:
We have 2 same indexes, one is unique. Query 1, this one won't be using index AT ALL (look at force index)
Query 2:
=> The non-unique index is used. Query 3: The server won't use the unique index, even if it's EXACTLY the same as non-unique index. Questions:
Problems like that are actually hard to spot as there's no DOC in mariadb / mysql considering the topic. Needs some documentation if unique indexes are treated differently in JOINS, so the users will know where it'll be beneficial to add duplicated index like that. |
| Comments |
| Comment by Sergei Golubchik [ 2014-02-12 ] |
|
This doesn't look like a bug. Please post this question to maria-discuss@lists.launchpad.net |