I\'m reading all about how clustered indexes work, and think they would be beneficial to my app. I understand that primary keys are automatically clustered indexes, but how
I suggest that you are asking the wrong question.
One alternative question is "Can I get rid of my current PRIMARY KEY
so I can make this other thing 'clustered'?" Often an AUTO_INCREMENT
can be eliminated or turned into a simple INDEX
.
The more likely question is "What is the optimal index for this SELECT ...
?". Others have pointed out that a second clustered index is out of the question for basic MySQL, so what is the next choice? I can't answer that without knowing the SELECT
. However my Index Cookbook answers the question for a large let of SELECTs
.