September 2007 - Utility of the Month

"SQLQueryStress: Sql Server query performance testing tool"

I found this month's utility reading Adam Machanic's newest book Expert SQL Server 2005 Development - a book I highly recommend for advanced Sql server developers.  Lately I've found myself using this utility quite a bit so I thought it would make a great candidate for this month's utility.

SQLQueryStress

Ever find yourself running a long sql statement (and timing it in Sql Management Studio) or trying to speed up a stored procedure by trying multiple ways to write it or wondering how a certain load is going to effect a stored procedure?  Fortunately or not, I have found myself in all those situations.  Lately I have been doing the second one - trying multiple ways to get the same thing - then checking the performance of each one. 

imageSQLQueryStress is a utility that does one thing and does it well.  Just start it up, set your database connection information and start running sql statements against the database (using up to 200 threads and up to 100,000 iterations of your sql statement) and you start seeing IO and timing statistics right away.  Adam has done a good job of documenting the utility, so I'm not going to go into too much detail.

Besides setting the number of times the statements should be executed, you can setup parameter substitution to plug in values for the parameters as it cranks through the iterations (which can even be queries from other databases or tables).  I'll have to admit I haven't used the parameter substitution feature too much yet, but I'm sure I will after I get past my R&D stage.  Once you have set the query the way you want it to run and the options set (File->Options), you can save the query and settings for running again later (File->Save Settings and File->Load Settings) - Very handy feature!

Where you can find the utility:

SQLQueryStress home site

(download page, documentation page)

I'm sure you'll find Adam's utility a good addition to your toolbox if you do any type of Sql perf testing (even if it is just another set of perf numbers you can use for evaluating the overall picture).  Try it out and let me know what you think, I'm always curious :)

posted on Monday, September 10, 2007 9:10 PM

Feedback

# re: September 2007 - Utility of the Month

I am not sure if the results of this stress test is correct. I used the test example laid out by Adam on the AdventureWorks database. Instead of using the Parameter Substitution, I wanted to see what the reuslts would be to run the query once using 1 iteration and 1 thread and passing a EmployeeID value into the stored procedure. I click on the GO button and it said that it took 1 minute and 35 seconds to run this stored procedure. I mean that cant be right? When I run the same stored procedure using the SQL Server Management Studio tool, the query runs in a second. I am only running 1 iteration and it says that the Client Seconds/Iteration avg is 35 seconds. So does this mean that the other 1 minute of time is for connection and tear down of the connection?
4/30/2008 11:32 AM | Mike

Post Comment

Title  
Name  
Url
Comment   
Please enter the following code into the box below to stop spammers

  
Enter Code Here *