T-SQL PERFORMANCE TUNING AND QUERY OPTIMIZATION
By Corwin Ashford
- Release Date: 2026-03-10
- Genre: Databases
Description
Write faster, more reliable T SQL by understanding how SQL Server and Azure SQL actually execute your queries and by applying tuning decisions that hold up in production. Performance problems rarely come from one cause. Slow queries, unstable plans, blocking, poor indexing, bad statistics, tempdb pressure, and parameter sniffing often overlap, which makes guesswork expensive. This book helps you work through those problems in a practical way, starting with measurement and baselines, then moving into execution plans, indexing, cardinality estimation, concurrency, monitoring, and real tuning workflows. Instead of offering vague advice, this guide explains how the engine processes T SQL, how the optimizer chooses plans, and how to diagnose what is really happening when a system slows down. It is written for developers and database professionals who want clear explanations, realistic examples, and techniques they can use on production databases. Inside this book, you will learn how to: Define meaningful performance targets and build reliable baselines Read estimated and actual execution plans with confidence Recognize query and schema anti patterns that hurt performance Design rowstore, filtered, columnstore, and partitioned indexing strategies Use statistics and cardinality estimation to improve plan quality Diagnose and mitigate parameter sniffing and plan instability Apply intelligent query processing features more effectively Understand locking, blocking, row versioning, and deadlocks Tune tempdb, memory, CPU, parallelism, and wait statistics Monitor workloads with DMVs, Extended Events, and Query Store Use automatic tuning and plan forcing for hard to change queries Tune Azure SQL workloads with service tier and cost awareness Evaluate when In Memory OLTP and other specialized features fit Follow end to end workflows from symptoms to root cause and fix The book also includes practical case studies, end to end tuning workflows, and a final toolkit focused on scripts, checklists, and automation so you can turn the concepts into a repeatable process. This is a code heavy guide, with working T SQL examples throughout to help you test ideas, inspect behavior, and apply tuning techniques in real environments. If you want a grounded, thorough guide to writing high performance queries and solving production database problems with more confidence, this book will give you the tools to do it.

