How many indexes is preferred for one table in MySQL??
I have a company table where I search mostly for ID, state, and category.
There is no one single answer for this question: create as many indexes are required to make your queries fast enough, and no more.
You have to trade off various things when deciding what to index:
For your particular scenario, it seems like three indexes, one on ID (if this is the primary key, then it already has an implicit index), one on state and one on category, would suffice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With