Summary
This chapter has provided you with several tuning techniques you can use to find out how your queries are using system resources such as disk and CPU. First, we explained some essential DMVs and DMFs that are very useful for tracking expensive queries. Two features that were introduced with SQL Server 2008, extended events and the Data Collector, were explained as well, along with how they can help capture events and performance data. We also discussed SQL Trace, a feature that has been around in all the SQL Server versions as far as any of us can remember.
So, now that we know how to find the expensive queries in SQL Server, what’s next? Our final purpose is to do something to improve the performance of the query. To achieve that, we will cover different approaches in the coming chapters. Is just a better index needed? Maybe your query is sensitive to different parameters, or maybe the query optimizer is not giving you a good execution plan because a used feature does not have good support for statistics. We will cover these and many other issues in the following chapters.
Once we have found the query that may be causing the problem, we still need to troubleshoot what the problem is and find a solution to it. Many times, we can troubleshoot what the problem is just by inspecting all the rich information that’s available in the query execution plan. To do that, we need to dive deeper into how the query optimizer works and what the different operators the execution engine provides. We will cover those topics in detail in the following two chapters.
Updated |
Rows Above |
Rows Below |
Inserts Since Last Update |
Deletes Since Last Update |
Leading column Type |
Jun 7 2022 |
32 |
0 |
32 |
0 |
Ascending |
Jun 7 2022 |
27 |
0 |
27 |
0 |
NULL |
Jun 7 2022 |
30 |
0 |
30 |
0 |
NULL |
Jun 7 2022 |
NULL |
NULL |
NULL |
NULL |
NULL |
Updated |
Rows Above |
Rows Below |
Inserts Since Last Update |
Deletes Since Last Update |
Leading column Type |
Jun 7 2022 |
27 |
0 |
27 |
0 |
Unknown |
Jun 7 2022 |
30 |
0 |
30 |
0 |
NULL |
Jun 7 2022 |
NULL |
NULL |
NULL |
NULL |
NULL |