SQLBits 2024
When to stop tuning a query
In this session, I'll demonstrate various tuning techniques and the challenges associated with each. I will guide you through the process of tuning of a single TSQL query and help you understand when to know it's optimized enough.
In this session, you will watch me tune a simple, but surprisingly slow Transact-SQL query. I'll demonstrate various tuning techniques and the challenges associated with each. I will guide you through the process of tuning it and help you understand when to know it's optimized enough.
Initially, I will apply several query hints to override certain optimizer decisions, aiming to mitigate the performance issue.
Next, I will rewrite the query and use several tricks to lead the optimizer toward more accurate estimations and optimal plan decisions. Moreover, you'll see how upgrading to SQL Server 2019 can break this workaround.
Finally, I will explain why SQL Server initially opted for an improper execution plan for this seemingly straightforward query and address the root cause. I'll emphasize the distinction between temporary fixes involving hints and optimizer strategies, and genuine solutions rooted in eliminating the underlying issue.
Initially, I will apply several query hints to override certain optimizer decisions, aiming to mitigate the performance issue.
Next, I will rewrite the query and use several tricks to lead the optimizer toward more accurate estimations and optimal plan decisions. Moreover, you'll see how upgrading to SQL Server 2019 can break this workaround.
Finally, I will explain why SQL Server initially opted for an improper execution plan for this seemingly straightforward query and address the root cause. I'll emphasize the distinction between temporary fixes involving hints and optimizer strategies, and genuine solutions rooted in eliminating the underlying issue.
Speakers
Milos Radivojevic's previous sessions
When to stop tuning a query
In this session, I'll demonstrate various tuning techniques and the challenges associated with each. I will guide you through the process of tuning of a single TSQL query and help you understand when to know it's optimized enough.
Dealing with Very Large Tables in SQL Server
What challenges do you face when dealing with tables that are over a terabyte in size? How do you index them? What do their statistics look like? How do you update them, and how do you fight against index fragmentation? How does all of this affect the estimation of the amount of data and how to tune queries involving very large tables?