I checked this SO post:
What's the difference between primary key, unique key, and index in MySQL?
and found the statement:
Also note that columns defined as primary keys or unique keys are automatically indexed in MySQL.
Based on this, I have two questions:
- Am I safe in assuming that there is no performance benefit to creating an index on a primary key itself because the primary key, by design, is an index?
Perhaps the more important question:
- If you are doing the classic example people cite, doing SELECT based on lastName and firstName, and that table has a primary key that you SELECT by frequently as well, would you create the index as (primary_key, lastName, firstName) or just (lastName, firstName) since the primary key is already an index?