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?