Most common questions used to investigate
Do you have keys on the table? (You can check with: SHOW CREATE TABLE)
Are the columns in your keys used in in the WHERE section of the query?
Is the column in a function or equation? Like
Are both sides of the comparison of the same type?
Is your DB using a different index? You can check by putting EXPLAIN before your query.
Common conclusions
You need to add keys. The command is: ALTER TABLE the_table ADD KEY(column1, column2);
You need to ADD the index for MySQL to use it. The command is: ALTER TABLE the_table ADD KEY(column1, column2);
The col_name needs to be by itself for MySQL to use that columns key. For example, change POW(col,2) / 2 > 100 TO col > POW(200 * 2, 0.5)
The database may be converting the column to another type which stops the index from being used. CONVERT or CAST other side to the correct type.
Perhaps the database is using a different index. You can give the DB a hint like this:
Add more information to this case and I'll try to figure it out.
References
Related Problems
