Fixing regressed queries
Parameters are fundamental drivers of the query optimization process. We discussed the topic of parameter sensitivity, known as parameter sniffing, in the The importance of parameters section in Chapter 1, Understanding Query Processing, and the Query plan properties of interest section in Chapter 3, Exploring Query Execution Plans.
This brings us to the other main benefit of Query Store: tracking plan changes over time – in other words, regressions from parameter-sensitive plans. With this exercise, we want to make sure the volatility that can come with parameter-sensitive plans is addressed, and that the plan that is used is the one that’s best for most uses, if not all. If successful, we will address the complaints we’ve been getting that sometimes the application just slows down for a few minutes and then recovers.
To generate enough workload in our AdventureWorks
database, again, we will use the QueryStoreSimpleDemo.exe
application...