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.

Published by

Varun Krish

Varun Krish has been dabbling with computers and websites for almost 2 decades. He has traveled to over 30 countries and hopes to visit every country on earth one day. He is currently the Editor-in-Chief of FoneArena.com and also advises startups and product companies on how to build better products. You can follow him on @varunkrish

Leave a Reply

Your email address will not be published.