Assume we have table in MySql database that contains two columns A and B. And now I need to create a secondary index on them.
Question: is there any difference on how I choose order of columns in index(A|B or B|A) taking into consideration following statements:
- I will always perform selects filtering by both columns:
WHERE A=sth AND B=sthso there is no difference on how to choose leftmost part of index. - Values in column
Bare much more unique than values in columnA.