SQL Day 2022 - Why is the Same Query Sometimes Slow - Brent Ozar

SQL Day 2022 - Why is the Same Query Sometimes Slow - Brent Ozar

1.501 Lượt nghe
SQL Day 2022 - Why is the Same Query Sometimes Slow - Brent Ozar
You swear nothing has changed, but all of a sudden, out of nowhere, queries that used to be fast are suddenly slow. Even weirder, you take the slow query from the application, run it in SSMS, and it's totally fast! What's going on? You restart SQL Server or update statistics, and the problem seems to go away - but only for a few days or weeks, and then it comes right back. You're familiar enough with execution plans to realize that you're getting different plans, but...why? And how do you fix it long term? In this session, you'll see live demos of the most common culprit: parameter sniffing. You'll learn how to recognize parameter sniffing when it strikes, understand what causes it, see how to fix it short term with the lowest impact possible, and learn 7 ways to fix it long term. To get the most out of this session, you should have already watched the free online class How to Think Like the Engine, and be familiar with using SET STATISTICS IO ON to see logical reads.