March Question: What tool(s) do you use to help you identify and tune slow performing queries?
Database Administration | March 1, 2012 | 1:00 amTuning poorly performing queries is one of the most important jobs of the DBA. With this in mind, this month’s qustion is “What tool(s) do you use to help you identify and tune slow performing queries?” This can include tools that come with SQL Server, your own custom-written scripts, or third-party tools. Tell us about the tools you use, and why you have chosen to use them.
Post your responses to the SQL Server Question of the Month in the comments section below (at www.bradmcgehee.com if you are viewing this from a syndicated newsfeed). And don’t forget to enter your e-mail address when you post your response, so I can contact you if you win.
Because there is no right or wrong answer, this month’s winner will be selected randomly from all the entries that are received.
|
This Month’s Prizes
|
The prizes this month are an Amazon.com voucher worth US $50.00 and a license for the new SQL Monitor 3.0 (released during March), with one year of support and upgrades. SQL Monitor is a web-based monitoring and alerting tool which enables you to keep an eye on SQL server performance in real time on desktop machines and mobile devices. The new version will include custom metrics and alerts and new user roles. Try out a live demo of SQL Monitor now. |



DMVs and query plans are usually my first points of call. I do use the Database Engine Tuning Advisor sporadically, but with a pinch of salt.
SQL Sentry Performance Advisor is my primary tool.
Still use tracing, execution plans, DMVs frequently
I’m just scratching the surface of performance tuning, but so far I have used SQL Server built in reports and DMVs.
DMV’s. I don’t like leaving SSMS environment, I simply don’t like needing to use mouse etc to when I need to get something fast, and all the tools I have tested for monitoring need time to refresh, did not understand our multiple mounting points etc, they were not trusted in our environment, too many false alarms they generated etc. So far I have not seen any tool that can grab me the data I need compared to DMVs.
I use many different tools. I use these the most:
- Extended events
- SQL Trace
- Execution plans
- Plan cache
- DMO’s
- Management Data Warehouse
I use traces, dmvs and execution plans to identify and tune slow performance queries.
I use Adam Machanic’s sp_WhoIsActive and other DMVs to identify issues. I read execution plans with SQL Sentry Plan Explorer
I use a combination of DMV’s, traces, execution plans, SQL Server Consolidated Monitoring Tool (Jeff Carrington & Rodney Landrum).
I primarily use SSMS, Profiler and SQL Sentry Plan Explorer – SSMS and Profiler because it comes with SQL Server and Plan Explorer because it makes deciphering execution plans so much simpler.
DMV’s, execution plans, SQL profiler traces, and a couple home grow scripts mostly.
I mostly use DMVs to get retrieve worst performing queries by I/0, CPU, execution count. I also use SQL profiler traces to identify slow running queries. Once identified I would check execution plan, DTA, query optimization to further troubleshoot slow running queries.
I have found that SQL Index Manager has helped significantly resolve a number of performance issues by allowing us to reindex/rebuild indexes on the fly….
I´ve implemented Adam Machanic´s “Who is Active” on every SQL Srv I have to take care of.
That´s often my first approach if someone informs me that a particular query doesn´t perform very well.
Then I use the typical DMVs to pull out long running queries.
Sometimes, if it isn´t a particular query but a whole workload, I´ll use the PerfStatScripts, pull out a SQL Trace and PerfCounters and just consume every little information with SQLNexus to get these nice Reports.
That helps a lot to pinpoint particular issues, mostly bad perferoming queries.
DMV’s are my first go to. I also use profiler traces and execution plans.
I have used a lot of Glen Berry’s scripts to find performance problems. I have used the built in reports with 2008 R2 and I have used sqlnexus as it is a great addition to sqldiag and tracing to identify problems with my servers. Other than that I use an open source monitoring tools such as Cacti to perform queries on the databases then report back to a central hub for analysis. It is hard finding time to monitor everything and even when your ‘supposedly’ monitoring everything you still miss something or you find that you need to monitor more! But thats monitoring in a nutshell. Brad your awesome!
I use a combination of tools like the Sql Profiler along with system monitor and show plan stats with index tuning wizards, but the one I found the best was the latest sql monitor ( trial version) which truly is awesome
The most useful tool that I have is Idera’s Diagnostic Manager.
Sorry about that but that’s where my small budget was spent.
I use the freely downloadable Performance Dashboard reports (which use the dmv) and have them available as custom reports on most servers. They give most expensive queries in a friendly form and I can then take the worst offenders and examine the execution plans and apply various techniques for improvement.
The Microsoft Tuning and Optimizing Queries course was very useful too.
As funds are VERY limited in my current positions, query execution plans are my “go-to” diagnosis tool. I have used SQL Profiler and Query Tuning Advisor in the past and they usually do an excellent job identifying the “hot-spots” but then you have to figure out the “cure” so to speak. I am starting to learn to use DMVs more and more as well.
Fortunately we’ve carved out time for performance tuning so that the primary sources of identifying slow queries are no longer the telephone and email. We’re still getting traction, but we use a combination of:
- DMVs (for missing index, unused index & heap identification)
- SQL Profiler (filtered to look for the CPU/IO/Duration heavyweights)
- Execution Plans
- Tuning Advisor (also with a pinch of salt & caution)
- PerfMon
- Red Gate SQL Monitor (although we use it more for alerting at present)
We use Idera SQL Diagnostic Manager.
SQL Sentry Performance Advisor and a selection of DMV queries taken and modified from “Performance Tuning with SQL Server Dynamic Management Views” book by Louis Davidson and Tim Ford.
Native tool like profiler and query plan.
I use a mix of DMVs, SQL Profiler and DTA.
Mainly profiler. I check for queries using high cpu and/or high disk I/O.
Check the plan for table scans or lots of index scans running a long time. also the join types.
Normaly it is lack of indexes.
Then I would check small queries running many many times.
Also uniqune sql’s not using plan chaching.
To tune slow queries:
- SSMS (event monitor)
- Execution plan
To identify slow queries
- Profiler +
basically .. I use a mix of all these tools:
- SQL Server Profiler
- Qure Workload Analyzer
- SQL Sentry Plan Explorer
- Dyamic Management Views to identify the unused indexes for droping them, Finding required indexes to optimize query execution.
- Execution Plans – to prefer Index seeks rather using table scan and index scan. This techinique is used only for tables having more rows.
-Verifying the Table zise and determining the requirement of Indexes :-Tables having less rows are not recommented for the creation of Idexes and tables which are modified very often is not indexed since the Index Maintenance requires more system resources.
–Locking :- Appling proper locking helps to improve the performace of queries.
– Maintaing Short transactions in stored pocedures, since small transactions won’t create much loging and it considerable reduce IO bottle neck.
- SQL Profiler – filtered to look helps to indentify the usage of CPU/IO/Duration etc.
– Automatted log shipping process will help to improve the performace of SQL server.
–Verifying the Database status, Auto-Grow, Recovery model, Logging mode etc.
i) Used Dyamic Management Views to identify the unused indexes for droping them, Finding required indexes to optimize query execution.
ii) SSMS Execution Plans – to prefer Index seeks rather using table scan and index scan. This techinique is used only for tables having more rows.
iii) Verifying the Table zise and determining the requirement of Indexes :-Tables having less rows are not recommented for the creation of Idexes and tables which are modified very often is not indexed since the Index Maintenance requires more system resources.
iv) Locking :- Appling proper locking helps to improve the performace of queries.
v) Maintaing Short transactions in stored pocedures, since small transactions won’t create much loging and it considerable reduce IO bottle neck.
vi) SQL Profiler – filtered to look helps to indentify the usage of CPU/IO/Duration etc.
vii) Automatted log shipping process will help to improve the performace of SQL server.
viii) Verifying the Database status, Auto-Grow, Recovery model, Logging mode etc.
SQL Monitor, DMVs, traces
Thanks for everyone who participaterd in this month’s Question of the Month. The randomly selected winner of this month’s question was Zach M. He won a $50 Amazon gift certificate and a license to SQL Response 3.0. Don’t forget to enter the April Question of the Month.