How many indexes per database table?

How many indexes are preferred for a single table in MySQL?

I have a table companywhere I am looking mainly for ID, stateand category.

+3
source share
2 answers

There is no answer to this question: create so many indexes to make your queries fast enough and no more.

You have to trade various things when deciding what to index:

  • The more indexes you have, the slower the inserts and updates will be (because they need to update all indexes)
  • , .
  • (, "gender", "M" "F" )

: ( , ), , .

+5

"" , . , ID, .

0

Source: https://habr.com/ru/post/1745708/


All Articles