Category: SQLServerCarpenter Tools

usp_SQLServerCarpenter_Tools_Get_Costliest_Queries

This procedure can get you the list of queries being executed frequently and for duration greater/less than a particular time. You may also find it very useful if you are doing multiple things to optimize the database (such as server or database setting changes, indexing, stats or code changes etc.) and you would like to track the duration to see if you are really making progress. You can create a job with this procedure and dump the output in some table. Job can be scheduled to run in certain frequency. Later, you can plot trend out of the data tracked.