Skip to content
Advertisement

How to check the query is using the indexes in mysql

I have a SQL query with where clause, I have created the index for the columns which are being used in the where clause. How can I check the query is using the indexes for these columns?

Advertisement

Answer

Write “explain ” in front of your query. The result will tell you which indexes might be used. For example:

explain select * from cars;

You can check the column “Extra” for the information.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement