How many indexes are preferred for a table in MySQL ??
I have a company
table where I am mostly id
, state
, and category
To search for.
There is no single answer for this question: Make many indexed queries sufficiently It is necessary to make enough, and not.
You have to close various things when deciding the index:
- The more indexes you have, the slower inserts and updates will be made (because they update all indexes Some columns do not need to be indexed (for example,
- A 'gender' column where only possible value "M" Or "F")
For its special scenario, it seems like three indexes, i On the one (if it is primary key, it is already an inherent index), on one state and one square, enough will be enough.
Comments
Post a Comment