Imagine a table with multiple columns, say, id, a, b, c, d, e
. I usually select by id
, however, there are multiple queries in the client app that uses various conditions over subsets of the columns.
When MySQL executes a query on a single table with multiple WHERE conditions on multiple columns, can it really make use of indexes created on different columns? Or the only way to make it fast is to create multi-column indexes for all possible queries?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…