In general, what you do is use the functions in mysql that tells you what the database will do with your query. See
DESCRIBE SYNTAX. This will almost always tell you where you need a good index and also possible give you a hint of what to do with the query to make it faster.