I would like to know if it is necessary to create an index for all fields within a table if one of your queries will use SELECT *
.
To explain, if we had a table that 10M records and we did a SELECT *
query on it would the query run faster if we have created an index for all fields within the table or does MySQL handle SELECT *
in a different way to SELECT first_field, a_field, last_field
.
To my understanding, if I had a query that did SELECT first_field, a_field FROM table
then it would bring performance benefits if we created an index on first_field, a_field
but if we use SELECT *
is there even a benefit from creating an index for all fields?