Tag Archives: SQL

What One Query Can Do

I recently took on a legacy application.  The client was complaining of site speed issues.  Specifically on Saturday and Sunday the site would just crawl.  For a few hours the site would even go down.  I installed NewRelic and started looking for the problem.  Within a few minutes, I found the issue.  One page of the site that displays data from SQL is where 80% of the time is spent on the site.  There was a particular stored procedure that was running.  Upon inspection on the query I found that the SQL was using some odd way of pulling data, instead of using JOINS.  Once I changed the SQL in the stored procedure (and tested the results) we launched it to the clients live application.  Instantly, the web application became more responsive and within a week we had several compliments sent through a feedback tool.  We went from a 5-15 second load time, to less than 500 milliseconds!

Image

It’s crazy to think, that in our profession, how much of an impact a few words in a single query can have.

Advertisements
Tagged ,