The index is best suited for a value as unique as possible . For example, useless places the index on a column, where 50% of this column is the value "A", and another 50% of the column is the value "B".
Thus, the table will scan at least 50% of the records before choosing the correct values.
So, the best practice is to put the index in the most unique columns and only those columns that are used to select queries using.
example: if you need to create a selection for a typical "login", you must put the index in the "Username" column, as you will see that the username is unique.
Steven ryssaert
source share