Have you ever found yourself in need of making queries go faster but didn't know where to begin? In this session, you will learn multiple ways to find your top offending statements. You will learn three key tips to help you understand execution plans. Finally, you will learn a framework to help you create indexes to help performance.
3. Goal of Today’s Session
Arm anyone who is new to performance
tuning with processes and skills to
identify and solve some common
performance problems.
4. Today’s Agenda
Find Your Top Offenders
Understanding Execution Plans Basics
Index Framework to Improve Performance
6. Basic Query Runtime
Time
T1 : Resource not
available (Suspended
Query)
T2: Resource Now
Available. Back in
schedule queue.
(Runnable State)
T3: Continue Processing
(Resources acquired and
scheduled to run)
T3-T2
Signal Wait Time (Have resource
waiting to be scheduled to run)
T3-T1
Wait Time (Total waiting from
needing a resource to running
again)
Running
Suspended
Runnable
7. Meet the SQL Server Bottlenecks
7
Photos: http://www.flickr.com/photos/kaiban/5159888367/lightbox/ and http://www.flickr.com/photos/moodog/504456253 and
http://www.flickr.com/photos/marksze/4231115464 and http://www.flickr.com/photos/vvvracer/5264339383 and
http://www.flickr.com/photos/iphil_photos/4962369046
MEMORY DISK CPU
NETWORK LOCKING, BLOCKING & DEADLOCKS
8. When Do Top Offenders Matter?
Performance Problems NOW!
Root Cause Analysis (RCA)
Previous Performance Problem
Improve A Processes Performance
Migrations / Consolidation / Long Term
15. Indexing Tuning Process
1. Identify Tables in Query
2. Identify Columns being Selected
3. Identify filters (HINT JOIN and WHERE)
4. Find total rows for each table used in the Query
5. Find selectivity (rows with filter / table rows)
6. Enable statistics io, time and the actual execution plan.
7. Run the Query and document your findings
8. Review existed indexes for filters and columns selected
9. Add index for lowest selectivity adding the selected columns
as included columns
10. Run the Query again and document your findings.
11. Compare findings with baseline.
12. Repeat last four steps as needed.