Newest Industry

Evolving the Online Performance Experience

GrabPERF: Why EXPLAIN is such a useful SQL tool

leave a comment »

Now, EXPLAIN seems like such an old school SQL tool. Well, I am here to explain why it’s not something you should ignore.

The Index Chart queries were all doing table scans. This can be pretty painful; ok, this can be stupid and EXTREMELY painful. The cause: I was setting sub-optimal date ranges on my queries and making all kinds of crazy date_format calls to format the dates IN THE QUERIES.

Once I changed the code, even when the query cache is cleared, the Index Charts now all run at less than 1 second.

Colour me stupid.

Advertisement

Written by Stephen

September 14 2005 at 16:19

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 269 other followers