You’re a developer or a DBA, and you’re comfortable writing queries to get the data you need. You’re much less comfortable trying to design the right indexes for your database server. In this series of videos, you’ll learn how the SQL Server engine looks at your indexes and builds your query results.

In a few short sessions, you’ll learn:

  • The differences between clustered and nonclustered indexes
  • How (and when) to make a covering index
  • The basics of execution plans

Print out this 5-page PDF built from Stack Overflow’s database pages. Sounds crazy, but having these pages in hand is absolutely critical to understanding these concepts. Optionally, you can also download the slides for the presentation.

How to Think Like the SQL Server Engine: The Video

How to Think Like the Engine: Written Articles

Both the videos and the written articles cover the same basic topics – it just comes down to how you prefer to learn:

  1. How to Think Like the SQL Server Engine: Introduction
  2. Why Query Plans Can Look Different on Different Servers
  3. Adding an ORDER BY
  4. The Perils of SELECT *
  5. What Happens When You Run a Query Repeatedly
  6. Adding a Nonclustered Index
  7. So Index Seeks are Great, Right?
  8. What’s a Key Lookup?
  9. The Tipping Point: When a Scan Makes More Sense
  10. Using Statistics to Build Query Plans
  11. When Statistics Don’t Help
  12. Building Wider Indexes to Deal with Bad T-SQL
  13. Should Columns Go in the Index Key or Includes?
  14. Included Columns Aren’t Free
  15. Index Key Column Order Matters a Lot
  16. When a Seek Isn’t: Scan/Residual Predicates

Next Steps

Fundamentals of Index TuningWhen you’re ready to learn more, check out my one-day online course, Fundamentals of Index Tuning. You’ll learn:

  • How to design indexes for a query without looking at its execution plan
  • How to pick the order of keys in an index
  • How query parameter values can change which index is better
  • Where to find index recommendations using query plans, DMVs, and sp_BlitzIndex
  • How SQL Server’s index recommendations are built, and why they’re often wrong

Check it out and sign up here.