193 Thousand Percent Performance Improvement–in 10 Seconds

Written by Lyza Gardner on

Here at Cloud Four, we are always trying to make performance optimizations on customer Web sites and services. I noticed a custom WordPress plugin that I had written for a client was running a bit slower than I’d like today.

After just a quick bit of debug it was clear that the problem was an 850,000-row MySQL table. The plugin was making simple (read) queries to this table about a dozen times on each page load. This shouldn’t take so long!

I took a quick trip to the MySQL interpreter and added indexes to three columns. Some quick testing showed me that the instantaneous result (it took 10 seconds each to index the columns) netted an instant performance improvement of 193 thousand percent. That’s an improvement that will affect every visitor to this page in the future, and one I’m glad I made.

Adding indexes to a MySQL table is one of those basic-arsenal tools we use; it’s not ground-breaking nor particularly racy. But sometimes, in our valiant quests for speed and elegance, we can forget the simple tactics that make so much difference.

Lyza Gardner

Lyza Gardner is a writer for O’Reilly, A List Apart, Smashing Magazine, NET Magazine and co-founder of Cloud Four. Lyza advocates for elegant standards, education and compassion in pursuit of the best possible future Web.

Never miss an article!

Get Weekly Digests

Let’s discuss your project! Email Us