I'm looking for a possible index for the following:
select left(name,10), count(*) from tab group by left(name,10)
This is the table config:
create table tab( id int(11), name text, primary key(id), key name(name(10)))
The optimizer does not uses the index for the select. Any idea if that possible in MySQL? In Oracle for example I can create index on functions, which is not supported in MySQL.