I have a MySQL table. It has two columns. First one is a unique identifier (INT) and the second is a string (VARCHAR). There's around 1.7m records. At the moment, the only search I am doing is:
select name from artist_name where name like '$q%'"
My question is what would be the best index to put on this table and how could I improve the efficiency, if at all, of the SQL statement? At some point I will be introducing a 2nd table that will join on the first column but I'll tackle that at a later point.
Use B-Tree indexes
Check this.