This book provides a comprehensive overview on best practices for troubleshooting and performance tuning in SQL Server. It reviews how to identify performance issues, how to troubleshoot the system in a holistic fashion, and how to properly prioritize tuning efforts in order to induce the best system performance possible. The book also discusses interdependencies between database components, while spotlighting ways to avoid the bottlenecks that can be triggered by those dependencies. The troubleshooting and performance tuning techniques presented in the book are compatible with any version of SQL Server. They cover both on-premise and Cloud-based SQL Server installations, including Microsoft Azure SQL Databases and Amazon SQL Server RDS. Reflecting the approaches used by many high-end SQL Server consultants, SQL Server Advanced Troubleshooting and Performance Tuning is a valuable resource that will help readers master troubleshooting and performance tuning skills and get the best performance out of SQL Server.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A practical, consultant-grade guide to SQL Server troubleshooting and performance tuning, teaching you how to identify bottlenecks holistically, prioritize fixes, and optimize any version of SQL Server—on-premises, virtualized, or in the cloud. Ideal for database administrators, developers, and IT pros who want to move beyond reactive fixes and master systematic performance analysis.
【Book Arc】
- **Opening (~0%–10%)**: Sets the stage with the book's philosophy—troubleshooting is a holistic process, not a series of isolated fixes. It introduces the importance of proper SQL Server setup and configuration, including virtualization considerations, and establishes the foundation for understanding how components interact.
- **Early (~10%–25%)**: Covers the core execution model and wait statistics. This section explains how SQL Server tasks move through RUNNING, RUNNABLE, and SUSPENDED states, and introduces the "observer effect"—how monitoring itself can impact performance. It also discusses consolidation strategies, warning against mixing OLTP and data warehouse workloads on the same instance.
- **Early (~25%–35%)**: Delves into the I/O subsystem, detailing how SQL Server handles reads and writes, including asynchronous log writes and checkpoint processes. It provides practical guidance on using performance counters like Avg Disk sec/Read and Page Life Expectancy (PLE) to diagnose disk bottlenecks, and lists critical I/O errors (823, 824, 833, 825) that require immediate attention.
- **Middle (~35%–50%)**: Focuses on identifying inefficient queries. It covers using DMVs like sys.dm_exec_query_stats to find expensive queries, the limitations of plan cache–based analysis, and the importance of Extended Events and Query Store for capturing queries that don't cache plans. It also includes practical advice on Query Store sizing and maintenance.
- **Middle (~50%–100%)**: The book continues with advanced topics, including tempdb configuration and contention, latch types and hotspot mitigation (e.g., OPTIMIZE_FOR_SEQUENTIAL_KEY, hash partitioning, In-Memory OLTP), and transaction log management. Each chapter concludes with a troubleshooting checklist, reinforcing the practical, step-by-step approach.
【Key Takeaways】
- **Holistic troubleshooting beats isolated fixes** (Opening): Performance issues often stem from interdependencies between components (CPU, I/O, memory, configuration). The book's core message is to analyze the system as a whole, not just individual queries, to avoid creating new bottlenecks. (Early)
- **Understand the task lifecycle to reduce query time** (Early): A task spends time in RUNNING (CPU work), RUNNABLE (waiting for CPU), and SUSPENDED (waiting for resources). Tuning means reducing time in any of these states—via query optimization, hardware upgrades, or load reduction. (Early)
- **Monitoring has a cost—the observer effect** (Early): Every monitoring tool adds overhead. The book warns against aggressive monitoring (e.g., frequent index fragmentation scans) that can flush the buffer pool and degrade performance. Choose monitoring strategies that balance insight with impact. (Early)
- **Virtualization is fine, but adds a troubleshooting layer** (Early): Properly virtualized SQL Server is acceptable for most workloads. However, you must monitor host health and resource allocation (vCPUs, memory) because an overloaded host may not show up in guest VM metrics. (Early)
- **I/O troubleshooting starts with latency and queue length** (Middle): Use Avg Disk sec/Read, Avg Disk sec/Write, and Avg Disk Queue Length to spot spikes. Correlate these with SQL Server–specific counters (e.g., Checkpoint pages/sec) to identify the root cause, such as checkpoint bursts overwhelming the disk. (Middle)
- **Plan cache analysis is a great starting point, but has blind spots** (Middle): DMVs like sys.dm_exec_query_stats provide immediate, automatic data on expensive queries. However, they miss queries with statement-level recompiles or RECOMPILE hints; use Extended Events or Query Store to capture those. (Middle)
- **Query Store is powerful but needs careful management** (Middle): Avoid creating a very large Query Store and monitor its size, especially with QUERY_CAPTURE_MODE=ALL. Apply latest updates, particularly for SQL Server 2016/2017, to benefit from scalability fixes. (Middle)
【Reading Tips】
- **Skim the opening chapters for philosophy, deep-read the practical sections**: The early chapters establish the "why" (holistic approach, observer effect). The later chapters (tempdb, latches, transaction log) are where you'll find actionable, code-heavy solutions—read those carefully.
- **Focus on the troubleshooting checklists**: Each chapter ends with a checklist. Use these as a quick-reference guide during real incidents; they distill the chapter's key diagnostic steps into a practical workflow.
- **Pay special attention to the I/O error codes (823, 824, 833, 825)**: These are critical for production support. Memorize what they mean and the immediate actions required (e.g., run DBCC CHECKDB for 605/824, check disk health for 833/825).
- **Don't skip the virtualization and consolidation advice**: Even if you're not a DBA, understanding why mixing OLTP and data warehouse workloads is bad, and how TDE affects tempdb, will help you make better architectural decisions.
- **Use the companion code**: The book references listings (e.g., Listing 3-3 for PLE, Listing 4-4 for query stats). Download the code from the companion site to save time and avoid typos when implementing the scripts.
【Coverage Limits】
This guide is based on a sample of excerpts covering roughly the first half of the book (setup, execution model, I/O, and query analysis). The later chapters on tempdb, latches, and transaction log are mentioned in the table of contents but not deeply covered in this guide.
Excerpt 1
278 Common tempdb Issues 281 System Page Contention 283 Running Out of Space 287 tempdb Configuration 290 Summary 291 Troubleshooting Checklist 292 10. Latch...
, c.value_in_use, c.value ,d.def_value, c.is_dynamic, c.is_advanced FROM sys.configurations c JOIN @defaults d ON c.name = d.name WHERE c.value_in_use <> d.d...
ands of logical reads with just a handful of physical reads. Another example is ramp-up reads, which occur when SQL Server reads a large number of pages on e...
nless it is absolutely necessary. Capturing executed state‐ ments is an expensive operation that may introduce significant performance over‐ head in busy sys...
ical queries that process millions or even billions of rows. To address this, SQL Server 2012 introduced another execution model, called batch mode execution...
calling the procedure (test 2) DBCC FREEPROCCACHE; EXEC dbo.GetTotalPerStore @StoreId = 99; EXEC dbo.GetTotalPerStore @StoreId = 5; As you can see in Figure...
d is set, you can capture the blocked process report with a blocked_process_report xEvent or a Blocked process event SQL Trace event. Obviously, I recommend...
row-level locks to the table level during batch operations. In such cases, a full lock on the table may prevent other sessions from accessing it. Troubleshoo...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
SQL Server Advanced Troubleshooting and Performance Tuning (Dmitri Korotkevitch) (Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
SQL Server Advanced Troubleshooting and Performance Tuning (Dmitri Korotkevitch) (Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment