Achieving Gold Medal Performance From SQL Server


Published on

You can’t go wrong by starting with these SQL Server performance tips, which offer DBAs and others detailed information on specific issues and ways to apply them to their environment.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Achieving Gold Medal Performance From SQL Server

  1. 1. 3 Tips for Getting Gold Medal Performance From Your SQL Server Installation Adapted From Work by SQL Server Experts: Patrick O’Keefe Richard Douglas SQL Server DBA Professionals 1 SQLDBApros
  2. 2. Gold Medal Tip #1: Benchmark and Analyze Your Performance 2 SQLDBApros
  3. 3. Establish a performance baseline – Talk to system administrators, end users, and application administers get a feel for usage patterns/peakperiods/off hours/average use The more predictable your performance, the less data you will require. 3 SQLDBApros
  4. 4. Consider capacity – How much is required to store the data? How will it grow over time? Consider aggregating historical data in intervals Do not store measurement repository in same location as the database you are measuring. 4 SQLDBApros
  5. 5. Limit your changes – Test one hypothesis on each run Rule out ineffective methods Honing each change reveals additional improvement options. 5 SQLDBApros
  6. 6. Repeat the measurements – Compare original run and changed run Did you get the desired effect? Have any unexpected side effects? Objectively determine whether or not you made progress. 6 SQLDBApros
  7. 7. Establish performance norms – What conditions enable perfect performance? what scenarios hinder it? Perform capacity planning Extrapolate typical resource consumption per user – predict when your system will hit connection bottlenecks. 7 SQLDBApros
  8. 8. Rule out usual suspects – Troubleshoot problems more effectively Search for significant deviations from baseline Group related indicators Drill down into the root cause. 8 SQLDBApros
  9. 9. Gold Medal Tip #2: Find the Rogue Query 9 SQLDBApros
  10. 10. Find workload causing the bottleneck – This is a lot easier to do since the introduction of Dynamic Management Objects (DMOs) in SQL Server 2005 For a CPU bottleneck, the first thing is to get top CPU consumers on the server 10 SQLDBApros
  11. 11. Top CPU consumers query – This is a very simple query on sys.dm_exec_ query_stats: 11 The really useful part of this query is your ability to use cross apply and sys.dm_exec_sql_text to get the SQL SQLDBApros statement, so you can analyze it.
  12. 12. I/O bottleneck – 12 SQLDBApros
  13. 13. Gold Medal Tip #3: Utilize SQL Server Profiler 13 SQLDBApros
  14. 14. SQL Server Profiler – Profiler creates a trace file that captures events in SQL Server, proving invaluable in providing information on workload and poorly performing queries. View a video tutorial on SQL Server Profiler on Toad World. 14 SQLDBApros
  15. 15. Performance monitor – Perfmon allows you to collect data and correlate information on resource usage with data on the events being fired inside SQL Server 15 Note* running Profiler requires the ALTER TRACE permission. SQLDBApros
  16. 16. Here’s how… 1. Open Perfmon. 2. Prepare Data Collector Set or create a new one. DO NOT start set yet. 3. Open Profiler. 4. Create a new trace – specify instance, event, column, & destination details. 16 SQLDBApros
  17. 17. 5. Start the trace. 6. Switch back to Perfmon and start the Data Collector set. 7. Leave both sessions running until required data has been collected. 8. Stop the Profiler trace, save, and close. 9. Switch to Perfom, stop the Data Collector set. 17 SQLDBApros
  18. 18. 10. Open the saved trace in Profiler. 11. Click File  Import Performance Data. 12. Navigate to Data Collection File, select performance counters of interest. 18 SQLDBApros
  19. 19. You can now see the performance counters with the Profiler trace file (figure below) – enabling much faster resolution of bottlenecks. 19 SQLDBApros
  20. 20. Extra tip – The steps above use the client interface… to save resources… a server wide trace would be more efficient. For more details and seven other great tips, Download our Whitepaper. 20 SQLDBApros
  21. 21. Learn More SQL Server Tools– Free Trial Follow us on Twitter @SQLDBApros 21