IEPTO2: Immersion Event on Performance Tuning and Optimization – Part 2

(Formerly IE2)


This 3/400-level, 5-day, 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, deadlocking, 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: creating and using performance baselines, benchmarking tools, wait and latch statistics, Extended Events, DMVs, 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 should attend IEPTO1 next.

This course will cover SQL Server 2005 through SQL Server 2016, and 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 register? Please see our Immersion Events Schedule for class dates and our comprehensive Immersion Events F.A.Q. for class costs and other frequently asked questions.


Module 1: SQL Server I/O

Before we talk about how storage works, you need to understand what SQL Server needs. We cover SQL Server’s storage devices (data, log, tempdb, and backups) and their I/O patterns and trends. For each, we go into detail about how certain kinds of activities affect their performance and how to monitor resource usage using DMVs. Topics covered include:

  • Data and log reading and writing
  • Tempdb contention and space usage
  • Basic monitoring

Module 2: I/O Concepts for DBAs

Now that you understand what SQL Server needs from your storage, we can explore the different kinds of storage available to you. Topics covered include:

  • Defining storage terminology
    • IOPS, MB/sec, Latency
  • Magnetic vs. Solid-State Drives (SSDs)
  • RAID configurations
  • Mount points
  • Partition alignment problems
  • Testing with SQLIO and IOMeter
  • Direct-attached storage
    • Traditional vs. PCI-Express drives

Module 3: I/O – Storage Area Networks for DBAs

Shared storage makes things a lot more complicated, but we demystify the black box. We cover each of the major SAN components, explain how it affects SQL Server performance, and show how to get the right configurations from your SAN administrators. Topics covered include:

  • SAN components
  • Multipathing
  • iSCSI vs. fibre channel (FC)
  • Shared vs. dedicated arrays
  • Cache (on the drives, SAN controller, RAID controller, and Windows)
  • Clustering
  • Appendix: snapshot backups (SAN, not SQL)

Module 4: 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 5: Data Collection and Baselining

One of the fundamentals of performance tuning is being able to tell how performance has changed from a known point, and also what your system is capable of. This module will show techniques for load testing and creating a baseline. While using Profiler is an expected skill coming into this class, Profiler will still be discussed for some of its more advanced uses including server-side trace queues, automating traces through jobs, Transact-SQL and Performance Monitor counter thresholds as well as collecting the “RIGHT” data for analysis.

In addition to benchmarking and baselining, it is also important to know how to collect performance data on an ongoing basis. SQL Server 2008 and 2012 offer different options for collecting this data, which we discuss in this module. Also important is knowing how to use the data you collect it and analyze it. Therefore we also spend some time looking at some of the secondary tools that can be used to analyze collected data. 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
    • Distributed Replay Utility (DRU)

Module 6: 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 shows the T-SQL used to control them and the UI in SSMS that was added in 2012. Topics covered include:

  • Profiler vs. Extended Events
  • Extended Events core concepts
  • Event session basics
  • Event execution lifecycle
  • Event targets
  • Extended Events UI
  • Appendix

Module 7: Wait and Latch Statistics

The Waits and Queues performance tuning methodology is one of the cornerstones of investigating performance issues with SQL Server. SQL Server knows what it is waiting for, so ask it and then figure out what else in the system to investigate. This module will cover the methodology, common wait patterns and what they mean, as well as some deeper investigative techniques. Topics covered include:

  • Thread lifecycle
  • Waits, latches, spinlocks
  • DMVs
  • Common wait types

Module 8: Query Plan Analysis and Query Store

Once you’ve identified a query or batch that is associated with a performance issue, you’ll want to look at the query execution plan and see if there are ways that you can address the problem (or problems). Topics covered include:

  • Why look at query plans?
  • How to capture  query plans
  • How to analyze query plans
  • Understanding common operators
  • Know which plan patterns to watch for and investigate further
  • Using the 2016 Query Store

Module 9: 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
  • A cautionary tale about scalar functions

Module 10: Index Analysis

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 11: 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 12: 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 13: 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.

Ready to register? Please see our Immersion Events Schedule for class dates and our comprehensive Immersion Events F.A.Q. for class costs and other frequently asked questions.


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