Re: Indexes: how many, how much?
select ColumnA
from TableA
where ColumnB = 5
-->
INDEX(columnB, ...) -- By that, I mean either an index with just B, or an index starting with B.
select ColumnA
from TableA
where ColumnB = 5
and ColumnC = 2
-->
INDEX(B, C, ...) _or_
INDEX(c, B, ...)
Either will work equally well.
select ColumnA
from TableA
where ColumnB = 5
and ColumnC = 2
and ColumnD = 7
-->
Any INDEX starting with all three of B,C,D in any order
For all three of those selects, only one is needed, and it is good for all of them:
INDEX(columnB, columnC, columnD)
If you have more SELECTs, or you have 'ranges', or you have GROUP BY or ORDER BY, or..., then there are many more 'rules' on creating optimal index(es).