```json
{
    "title": "GrabPERF: Why EXPLAIN is such a useful SQL tool",
    "url": "https://performancezen.com/2005/09/14/grabperf-why-explain-is-such-a-useful-sql-tool/",
    "datePublished": "2005-09-14",
    "dateModified": "2022-04-28",
    "language": "en-US",
    "description": "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…",
    "author": "spierzchala",
    "publisher": "Performance Zen"
}
```

# GrabPERF: Why EXPLAIN is such a useful SQL tool

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.
