VarunKrish

MySQL Indexes

Today I was playing with my pet site FoneArena.com

Was figuring out ways of improving the site. And I had not added some highly accessed columns in a table as Indexes.

So i checked out what diff a query was going to make with and without an Index.

consider this simple query :

[code lang=”sql”]

SELECT Distinct col from table ORDER BY col ASC LIMIT 10

[/code]

The above query took 0.0034 seconds to execute

Now how indexing helped me reduce the query time to 0.0009 seconds.

Can you believe that ?

nearly 400% of time saved just by adding an Index.

Exit mobile version