In the “MySQL Query tuning 101” video, Alexander Rubin provides an excellent example of when to use a covered index. On slide 25, he takes the query
select name from City where CountryCode = ’USA’ and District = ’Alaska’ and population > 10000
and adds the index
cov1(CountryCode, District, population, name)
on table
City
. With Alex’s query tuning experience, making the right index decision is simple – but what about us mere mortals? If a query is more complicated, or simply uses more than one table, how do we know what to do? Maintaining another index …
[Read more]