SlideShare a Scribd company logo
1 of 35
How to Write a SQL Server
  Performance Review
  Brent Ozar, SQL Server Expert for Quest Software




     http://flickr.com/photos/sean002/2510541359/
     Photo Licensed with Creative Commons
Copyright © 2007 Quest Software
What The Heck Do I Know?
• SQL Server Expert
  for Quest Software
• Former SQL DBA, SAN
  admin, VMware admin
• Recovering ASP coder
• Specializes in
  performance tuning
• Came up through
  management, not IT
Today’s Agenda
•   The Deliverable
•   Gathering The Data
•   Finding the Problems
•   Mitigating the Problems
•   Writing the Report
•   Resources and Q&A
The Deliverable: A Report
Key Parts of Our Review
• Capture objective, definitive and
  credible metrics
• Analyze problems causing bad metrics
• List of ways we could mitigate each
  problem
Definitive Metrics
• Start with Perfmon:
  www.BrentOzar.com/perfmon
• Gather for longest time possible
• Check results daily to refine metrics
Tracing the Problems
• Focus the trace on the problem
  statistics (CPU, reads, writes)
• Filter duration > 2000ms at first
• Refine duration filter down over time
• Put results in a different SQL Server
  – Very fast server, faster than what you’re tracing
  – Write into a simple mode database, no backups
Querying the Trace Table
ORDER BY Duration DESC
Casting and Grouping
Correlate the Metrics & Queries
• Demonstrate good investigation skills
• Show a cause and effect relationship
• Fields to mentally “join” on:
  –   Date/Time ranges
  –   CPU
  –   Reads/Writes
  –   Duration
DO NOT FIX ANYTHING YET!
•   No matter how easy it looks
•   No matter whose fault it is
•   You have to show fruits from your labor
•   We want clear before & after snapshots
•   Worst thing we can tell our bosses:
    “It’s OK now. I didn’t change much.”
Mitigations For Each Problem




           Photo From:http://flickr.com/photos/sneakums/1345233680/
A Problem Has Many Mitigations
• EVERY problem has multiple choices:
  – Money
  – Time
  – Manpower
• Go out of your way to identify all of them
Explain Mitigations That Suck
•   Shows you know about the option
•   May come in handy for another problem
•   Explain why it doesn’t work in this case
•   Displays wise decision-making
•   The PM may know something you don’t
Be Willing To Implement Them




         Photo From: http://flickr.com/photos/ninjapoodles/1130650313/
Sample Problem
• Metric:
  – Very high disk queue
    lengths on data file
    drive
• Trace tells us:
  – Report queries doing
    table scans without
    indexes
  – Many scheduled
    reports run
    simultaneously
Ways We Can Mitigate It
•   Add indexes
•   Run reports serially, not all at once
•   Add hard drives to the data file array
•   Add memory to cache scanned tables
Percent vs Order of Magnitude
• Incremental (Percentage):
  – Any improvement from 1% to 100%.
• Order of Magnitude:
  – Any improvement over 100% faster.
• How to explain it in your doc:
  – This mitigation should give an incremental
    (percentage) improvement.
  – This mitigation should give an order of magnitude
    improvement.
How To Explain It To Readers
 In this performance review, I classify mitigations as
 giving us a Percentage Improvement (meaning 1-
 100% faster) or an Order of Magnitude Improvement
 (meaning over 100% faster).

 In addition, because we’re talking about making
 multiple improvements simultaneously across
 different parts of the app and server, it’s hard to give
 exact numbers when one improvement might impact
 another area. A new index or server configuration
 change might improve performance for more than
 just one query or process.
This Is How DBAs Write:
Use A Different Way of Writing
• Be friendly and upbeat – ideas at:
  http://delicious.com/brento/powerpoint
• Document like a consultant
• Write like you’re an outsider looking in
• Create clear, concise steps that
  managers can assign to people
Don’t Point Fingers
Goal: Progress, Not Debating
Moving Your Career Forward
Your Target Reader…
• Reads Fortune,
  not SQL Magazine
• Doesn’t understand
  indexes or locks
• Wants answers,
  not questions
• Only reads the
  section headers
The Executive Summary
(Bunch of stuff here clipped out)
Wrapping It Up
•   Gather data with Profiler &Perfmon
•   Analyze the queries like it’s BI
•   Make a list of mitigation options
•   Write an upbeat, positive report
•   Aim for forwards, not replies
•   Save your reports for raise time!
My Resources, Your Questions
• My blog about SQL and performance:
  www.BrentOzar.com
  www.BrentOzar.com/perfreport
• My bookmarks:
  Delicious.com/brento
• SQL Server community w/expert Q&A:
  SQLServerPedia.com
• Performance tools for a second opinion:
  www.Quest.com

More Related Content

Similar to How To Write A SQL Server Performance Review

Pay pal paypal continuous performance as a self-service with fully-automated...
Pay pal  paypal continuous performance as a self-service with fully-automated...Pay pal  paypal continuous performance as a self-service with fully-automated...
Pay pal paypal continuous performance as a self-service with fully-automated...
Dynatrace
 
Perfmon And Profiler 101
Perfmon And Profiler 101Perfmon And Profiler 101
Perfmon And Profiler 101
Quest Software
 

Similar to How To Write A SQL Server Performance Review (20)

Perfmon And Profiler 101
Perfmon And Profiler 101Perfmon And Profiler 101
Perfmon And Profiler 101
 
Guerilla Usability Testing
Guerilla Usability TestingGuerilla Usability Testing
Guerilla Usability Testing
 
553: Oracle Database Performance: Are Database Users Telling Me The Truth?
553: Oracle Database Performance: Are  Database Users Telling Me The Truth?553: Oracle Database Performance: Are  Database Users Telling Me The Truth?
553: Oracle Database Performance: Are Database Users Telling Me The Truth?
 
Oracle database performance are database users telling me the truth
Oracle database performance are database users telling me the truthOracle database performance are database users telling me the truth
Oracle database performance are database users telling me the truth
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
Pay pal paypal continuous performance as a self-service with fully-automated...
Pay pal  paypal continuous performance as a self-service with fully-automated...Pay pal  paypal continuous performance as a self-service with fully-automated...
Pay pal paypal continuous performance as a self-service with fully-automated...
 
Building a Scorecard
Building a ScorecardBuilding a Scorecard
Building a Scorecard
 
Perfmon And Profiler 101
Perfmon And Profiler 101Perfmon And Profiler 101
Perfmon And Profiler 101
 
Software Test Estimation
Software Test EstimationSoftware Test Estimation
Software Test Estimation
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
 
SQLite3
SQLite3SQLite3
SQLite3
 
Qure Tech Presentation
Qure Tech PresentationQure Tech Presentation
Qure Tech Presentation
 
Top 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL ServerTop 10 DBA Mistakes on Microsoft SQL Server
Top 10 DBA Mistakes on Microsoft SQL Server
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
S.R.E - create ultra-scalable and highly reliable systems
S.R.E - create ultra-scalable and highly reliable systemsS.R.E - create ultra-scalable and highly reliable systems
S.R.E - create ultra-scalable and highly reliable systems
 
Getting It Done
Getting It DoneGetting It Done
Getting It Done
 
PostgreSQL Conference: West 08
PostgreSQL Conference: West 08PostgreSQL Conference: West 08
PostgreSQL Conference: West 08
 
Challenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous DeliveryChallenges and Best Practices of Database Continuous Delivery
Challenges and Best Practices of Database Continuous Delivery
 
Geek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
Geek Sync | Kick Start SQL Server 2016 Performance Tips and TricksGeek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
Geek Sync | Kick Start SQL Server 2016 Performance Tips and Tricks
 

More from Quest Software (9)

Virtualization and SAN Basics for DBAs
Virtualization and SAN Basics for DBAsVirtualization and SAN Basics for DBAs
Virtualization and SAN Basics for DBAs
 
Perfmon And Profiler 201
Perfmon And Profiler 201Perfmon And Profiler 201
Perfmon And Profiler 201
 
Advanced Index Tuning for SQL Server
Advanced Index Tuning for SQL ServerAdvanced Index Tuning for SQL Server
Advanced Index Tuning for SQL Server
 
SQL Server On SANs
SQL Server On SANsSQL Server On SANs
SQL Server On SANs
 
Disaster Recovery 101
Disaster Recovery 101Disaster Recovery 101
Disaster Recovery 101
 
CMDB Basics
CMDB BasicsCMDB Basics
CMDB Basics
 
Get Your Boss To Say Yes
Get Your Boss To Say YesGet Your Boss To Say Yes
Get Your Boss To Say Yes
 
Sql Server Service Broker In The Real World
Sql Server Service Broker In The Real WorldSql Server Service Broker In The Real World
Sql Server Service Broker In The Real World
 
Advanced Index Tuning
Advanced Index TuningAdvanced Index Tuning
Advanced Index Tuning
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

How To Write A SQL Server Performance Review

  • 1. How to Write a SQL Server Performance Review Brent Ozar, SQL Server Expert for Quest Software http://flickr.com/photos/sean002/2510541359/ Photo Licensed with Creative Commons Copyright © 2007 Quest Software
  • 2. What The Heck Do I Know? • SQL Server Expert for Quest Software • Former SQL DBA, SAN admin, VMware admin • Recovering ASP coder • Specializes in performance tuning • Came up through management, not IT
  • 3. Today’s Agenda • The Deliverable • Gathering The Data • Finding the Problems • Mitigating the Problems • Writing the Report • Resources and Q&A
  • 5. Key Parts of Our Review • Capture objective, definitive and credible metrics • Analyze problems causing bad metrics • List of ways we could mitigate each problem
  • 6. Definitive Metrics • Start with Perfmon: www.BrentOzar.com/perfmon • Gather for longest time possible • Check results daily to refine metrics
  • 7. Tracing the Problems • Focus the trace on the problem statistics (CPU, reads, writes) • Filter duration > 2000ms at first • Refine duration filter down over time • Put results in a different SQL Server – Very fast server, faster than what you’re tracing – Write into a simple mode database, no backups
  • 11. Correlate the Metrics & Queries • Demonstrate good investigation skills • Show a cause and effect relationship • Fields to mentally “join” on: – Date/Time ranges – CPU – Reads/Writes – Duration
  • 12. DO NOT FIX ANYTHING YET! • No matter how easy it looks • No matter whose fault it is • You have to show fruits from your labor • We want clear before & after snapshots • Worst thing we can tell our bosses: “It’s OK now. I didn’t change much.”
  • 13. Mitigations For Each Problem Photo From:http://flickr.com/photos/sneakums/1345233680/
  • 14. A Problem Has Many Mitigations • EVERY problem has multiple choices: – Money – Time – Manpower • Go out of your way to identify all of them
  • 15. Explain Mitigations That Suck • Shows you know about the option • May come in handy for another problem • Explain why it doesn’t work in this case • Displays wise decision-making • The PM may know something you don’t
  • 16. Be Willing To Implement Them Photo From: http://flickr.com/photos/ninjapoodles/1130650313/
  • 17. Sample Problem • Metric: – Very high disk queue lengths on data file drive • Trace tells us: – Report queries doing table scans without indexes – Many scheduled reports run simultaneously
  • 18. Ways We Can Mitigate It • Add indexes • Run reports serially, not all at once • Add hard drives to the data file array • Add memory to cache scanned tables
  • 19. Percent vs Order of Magnitude • Incremental (Percentage): – Any improvement from 1% to 100%. • Order of Magnitude: – Any improvement over 100% faster. • How to explain it in your doc: – This mitigation should give an incremental (percentage) improvement. – This mitigation should give an order of magnitude improvement.
  • 20. How To Explain It To Readers In this performance review, I classify mitigations as giving us a Percentage Improvement (meaning 1- 100% faster) or an Order of Magnitude Improvement (meaning over 100% faster). In addition, because we’re talking about making multiple improvements simultaneously across different parts of the app and server, it’s hard to give exact numbers when one improvement might impact another area. A new index or server configuration change might improve performance for more than just one query or process.
  • 21. This Is How DBAs Write:
  • 22. Use A Different Way of Writing • Be friendly and upbeat – ideas at: http://delicious.com/brento/powerpoint • Document like a consultant • Write like you’re an outsider looking in • Create clear, concise steps that managers can assign to people
  • 26. Your Target Reader… • Reads Fortune, not SQL Magazine • Doesn’t understand indexes or locks • Wants answers, not questions • Only reads the section headers
  • 28.
  • 29. (Bunch of stuff here clipped out)
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Wrapping It Up • Gather data with Profiler &Perfmon • Analyze the queries like it’s BI • Make a list of mitigation options • Write an upbeat, positive report • Aim for forwards, not replies • Save your reports for raise time!
  • 35. My Resources, Your Questions • My blog about SQL and performance: www.BrentOzar.com www.BrentOzar.com/perfreport • My bookmarks: Delicious.com/brento • SQL Server community w/expert Q&A: SQLServerPedia.com • Performance tools for a second opinion: www.Quest.com