Immersion Event on Performance Tuning and Optimization, Part 2

Upon completion: students will receive a verifiable badge through Credly/


This 3/400-level, SQL Server training class is part two of our two-part, comprehensive training program on SQL Server performance tuning and optimization (with IEPTO1 being the first half). Each week of this course stands alone, but we recommend taking Part 1 before Part 2, as more than 90% of people who attend IEPTO2 first then go back and take IEPTO1.

This class will give you a wealth of practical optimization techniques that you can put into production as soon as you return to work and we ensure you understand *why* and *how* a technique works rather than just what the technique is. Our aim is that you can apply what we teach you to any situation and justify your solution to your peers, management, or clients (yes, we welcome SQL Server consultants in our classes).

Building on the knowledge from IEPTO1, this course will teach you how to analyze your workload to figure out where performance problems and then how to fix them. Data churn varies, user needs change, and what the users told you during development often turns out to be untrue; the end result is that your tuning strategy needs to keep up. The key to long term success is being able to understand, recognize, and respond to these changes.

The core of this class is understanding resource usage and we will cover in-depth all the areas of concern for a SQL Server workload: I/O, CPU usage, memory usage, query plans, statement execution, parameter sniffing and procedural code, wait statistics, and the plan cache. All these topics will be addressed on multiple fronts: how SQL Server works, implementation considerations and techniques, and common problems, troubleshooting, and resolutions.

You will learn how to use specific tools and techniques for analyzing SQL Server, including Query Store, wait and latch statistics, Extended Events, DMVs, Distributed Replay, and PerfMon. These techniques will be highly adaptable to whatever situation you encounter and you will understand not just how to capture performance data but also how to interpret it, so you can derive answers to your own performance problems rather than relying on someone giving you the answer.

If you have previously attended IE2, you do not need to attend this course. If you have not attended IE1 or IEPTO1, you should attend IEPTO1 next.

This course is essential for all SQL Server developers, DBAs, and architects. We will answer all your questions, to whatever depth you want to go.

Instructors: Paul S. Randal, Kimberly L. Tripp, Jonathan Kehayias, Erin Stellato

Need Help Justifying Training? Here’s a letter to your boss explaining why SQLskills training is worthwhile and a list of community blog posts about our classes.

Ready to buy? Please see our Immersion Event Offerings for options, bundles, pricing. and more.

Quotes From Past Attendees

Listed below are some verbatim quotes from recent attendees of this class:

  • “Overall great! Lots of action items for me to take back and check out in my environments.”
  • “The SQLskills training courses are excellent! Thank you for offering such an outstanding set of courses dedicated to SQL Server!”
  • “Most DBAs would love to be an knowledgeable as any of the SQLskills employees.”
  • “The SQLskills classes never disappoint. So much information is presented in a short amount of time but that is so much better than most classes with a lot of free time and fluff.”
  • “Awesome course! Awesome instructors! Awesome event overall! The SQLskills courses are the best overall intensive courses for SQL Server.”
  • “By far the best training I have ever attended.”
  • “A fire hose to be sure. But the excellent notes and demo access make this probably the most valuable class I have ever attended.”
  • “Lots of deep-dive content. It was intense, but I learned a lot.”
  • “Excellent training. Learn a lot and will help grow my career as a SQL DBA.”
  • “So much useful and new information!”
  • “Great week. Great presentations. Great presenters.”
  • “A great course with much to take back to the office. Would recommend SQLskills to anyone and everyone.”
  • “I feel like a different DBA. I feel confident and ready to tackle anything.”
  • “All good – enjoyed the course hugely.”
  • “Having worked with SQL Server for a number of years, I had lots of questions/gaps in my knowledge/product features I wanted to know more about. I feel the course fulfilled all of my training needs and more.”


Module 1: Creating a Foundation for Tuning and Optimizing

Without the proper foundation, a building will be unstable and have the potential to crash at any moment. SQL Server is no different, and ensuring that you have the environment properly configured establishes the ideal foundation for tuning and optimization. In this first module we will cover best practices for configuration, options for validating, basics for performance monitoring, and steps to eliminate any low hanging fruit in the environment so you can then move forward with an accurate and in-depth analysis of problems. Topics covered include:

  • How we approach tuning and optimization
  • Server, instance, and database settings
  • Checking system health
  • Methods for analyzing performance

Module 2: Extended Events

Extended Events are a powerful way to look deeply into the internals of SQL Server without compromising performance, but there is a bit of a learning curve to extracting and analyzing the information. This module introduces Extended Events and steps through practical use cases that parallel, and exceed, what can be done with Trace. Topics covered include:

  • Transitioning from Trace/Profiler to Extended Events
  • Extended Events core concepts and architecture
  • Target practice
  • Event session basics
  • Actions, predicates, and system health
  • Extended Events UI

Module 3: Wait Statistics Analysis

The analysis of wait statistics is one of the cornerstones of investigating performance issues with SQL Server. SQL Server knows why executing threads are stalling, so we can ask it and then figure out what else in the system to investigate based on the analysis of wait statistics (or sometimes deeper latch or spinlock statistics). Topics covered include:

  • How thread scheduling works in SQL Server
  • Fundamentals of waits, latches, and spinlocks
  • Investigating waits, latches, and spinlocks using DMVs
  • Common scenarios, including:
    • Data and log file I/O
    • Latch contention in tempdb and user tables
    • Parallelism
    • Quantum exhaustion

Module 4: I/O Concepts and I/O Subsystems for DBAs

Many of the performance problems in SQL Server stem from issues surrounding I/O, but often a DBA doesn’t have the knowledge or terminology to effectively discuss I/O subsystems with the Storage Admin. This module will provide you with that information, from basic storage terminology to understanding how SANs work and can affect performance. Topics covered include:

  • Defining storage terminology
  • Magnetic vs. Solid State Drives (SSDs)
  • RAID configurations
  • Storage Area Networks
  • Configuring drives in Windows
  • Testing with Diskspd and Iometer

Module 5: SQLOS Scheduling and CPU Performance Tuning

SQLOS helps SQL Server perform by managing queries, internal jobs, the buffer pool, and many other shared resources. We discuss how SQL Server interacts with Windows and the underlying hardware, and how you may need to tweak it in order to really push the scaling limits. Topics covered include:

  • Understanding Windows scheduling
  • Server hardware and NUMA
  • CPU scheduling under SQLOS
  • DMV monitoring
  • Troubleshooting CPU performance issues
  • Using Resource Governor to limit CPU usage

Module 6: Analyzing Query Performance

One of the most common issues to affect a workload is a drop in performance for a query, or set of queries. This module will show you how to find changes in query performance when troubleshooting, baselining, and proactively analyzing a workload. We will discuss methods and tools for identifying variations in performance, how to analyze an execution plan, and options for addressing typical patterns found in plans. Topics covered include:

  • Capturing changes in query performance
  • Capturing and analyzing plans
  • Common operators
  • Essential information in a plan

Module 7: Putting New Features into Practice

One of the benefits of upgrading is the availability of new features, many of which have been added over the last several releases. In this module we will discuss some of the latest features and how they can be used to improve performance. Topics covered include:

  • Columnstore
  • In-Memory OLTP
  • Cardinality Estimator
  • Query Store plan forcing / automatic plan correction
  • Distributed Replay

Module 8: Statement Execution, Stored Procedures, and the Plan Cache

SQL Server contains a plethora of DMVs for gaining insight into what’s happening (and happened) on the system. In this module we investigate the most useful DMVs and show you their practical application as they apply to statement execution (ad hoc, sp_executesql, and dynamic strings), plan cache bloat, and stored procedures. Topics covered include:

  • Understanding/analyzing plan cache
  • What’s in the plan cache?
  • Understanding/optimizing stored procedures
    • Code coverage testing
    • Plan stability testing

Module 9: Index Analysis (if time permits)

Has it been a while since you attended IEPTO1? Have you gone back and done the appropriate level of index analysis? Most importantly, are your indexing strategies working? This relatively short module will tie back to IEPTO1 with a step-by-step process to ensuring optimal indexing over time. With primary focus on DMVs, the topics for this module include:

  • Index cleanup
  • Index health
  • Missing indexes

Module 10: SQLOS Memory Management and Memory Performance Tuning

SQLOS helps SQL Server perform by managing queries, internal jobs, the buffer pool, and many other shared resources. We discuss how SQL Server interacts with Windows and the underlying hardware, and how you may need to tweak it in order to really push the scaling limits. Topics covered include:

  • SQLOS Memory Manager
  • SQLOS memory components
  • Configuration options for SQL Server
  • How to identify memory issues
  • Internal memory pressure
  • External memory pressure
  • Virtual address space issues
  • Resource semaphores
  • DBCC commands

Module 11: Deadlock Analysis (if time permits)

While troubleshooting deadlocking in SQL Server has gotten easier in recent versions, it continues to be a constant source of problems. This module will look at the most common deadlocks and how to troubleshoot them using the various methods available to DBAs. Topics covered include:

  • Review of locking in SQL Server
  • What is a deadlock (reminder)
  • Collecting deadlock graphs
  • Anatomy of a deadlock
  • Reading deadlock graphs
  • Resolving deadlocks

Module 12: Performance Issue Patterns

This module draws together all the methodologies presented during the week to debug a variety of performance problems live and interactively with the class.

Appendix: Data Collection and Baselining

This module describes techniques for creating a baseline and capturing performance data with Performance Monitor and the deprecated SQL Trace/Profiler tools, and using free tools like PAL, SQLDiag, and SQL Nexus to analyze collected data. Although this module is an appendix, some of the tools covered will be used during demos in other modules. Topics covered include:

  • Benchmark vs. baseline
  • Data collection methods and tools
    • Performance Monitor and Collector Sets
      • PAL tool (Performance Analysis of Logs)
    • SQL Trace
    • Analyzing Trace data
    • SQLDiag
    • SQLNexus

Ready to buy? Please see our Immersion Event Offerings for options, bundles, pricing. and more.


If you have any questions not answered by our Immersion Events F.A.Q., please contact us.