Throughout their careers, database professionals are likely to encounter some of the following scenarios:
- Troubleshooting point-in-time performance regressions. In other words, the scenario where a query had been meeting performance expectations, but after an event it started to slow down. Finding the root cause may uncover opportunities to prevent queries that avoid regressions from reoccurring.
- Determining what the impact is of rewriting a T-SQL query. For example, when tuning a query, you may be required to rewrite it in part entirely. Does it actually perform better?
- Determining the impact of changing or adding a schema object such as an index. We discussed how these may be required in the Indexing strategy section of Chapter 5, Writing Elegant T-SQL Queries.
For all these scenarios, typically, we must compare query plans to determine what differences...