Troubleshooting SQL
Troubleshooting SQL
This flowchart is meant to address at a high level the most common issues that can affect performance and scalability in SQL Server 2005/
2008 implementations. This is an iterative process and should be performed only in a test environment.
Work left to
right, top to 1. READ 2. CAPTURE 3. EVALUATE 4. RESOLVE
bottom
Faster in SSMS?
YES Examine App for Modify
Result Handling Application Code
Does the query run faster in the
SSMS query window than in
from the application?
Ensure that the application is Ensure that only the results that
returning all of the results as soon are needed are being requested,
as possible to the client and that all results are consumed
as soon as possible
NO
Cannot Get an
More In-Depth
Optimal Plan? YES
Analysis
Statistics are up-to-date, all of
the above steps have been
followed, and it seems that the
Search on support.mcirosoft.com
optimizer has not selected an
and msdn.microsoft.com for more
optimal plan?
in-depth query tuning resources
Perform Index
Evaluate in SSMS Hash Joins, Sorts, YES and Query
and/or Filters? Analysis
Are there hash joins, sorts, and/ Determine indexes that will best
Copy each of the problematic
or filters displayed in the support this query, using the SSMS
queries into a SSMS query window
execution plan? query plan or the Database Tuning
and evaluate the query
Advisor.
Tool:
Search: support.microsoft.com
SQL Server Profiler
for ID 271509
Is the blocking script showing Are there currently open Ensure that the transactions are all
BLOCKING
Analyzing and
Avoiding Deadlocks in
SQL Server Tool:
SQL Server Profiler
Tool:
Search: www.microsoft.com/ SQL Server Profiler
technet for:
Batch Compilation, Ad hoc or Dynamic
Recompilation, and Queries? YES Rewrite Queries
Plan Caching Recompilations
Recompliations?
YES Rewrite Queries
Search: www.microsoft.com/
downloads for: Search: www.microsoft.com/
Search: www.codeplex.com downloads for:
for:
SQL Server 2005
RML Utilities for SQL
Performance DMVStats 1.01
Server
Dashboard