You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/features/automatic-tuning/force-last-good-plan/README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,11 @@ Open demo-full.sql and follow the comments in the code.
66
66
correction script is in the view
67
67
- Open Query Store UI in SSMS (e.g. "Top Resource Consuming Queries") and find the query. Verify that there are two plans - one faster with **Hash Aggregate** and another slower with **Stream Aggregate**
68
68
69
-

69
+

- Take the script from the `sys.dm_db_tuning_recommendations` view and force the recommended plan.
72
76
- Execute query `EXEC dbo.report 7` 20 times and verify that the execution is faster. Open Query Store UI in SSMS (e.g. "Top Resource Consuming Queries"), find the query, verify that the plan is forced and that the regression is fixed.
@@ -87,11 +91,13 @@ Web page collects response from the web server, calculates expected throughput b
87
91
last 10 T-SQL request durations, and displays how many requests per second can be executed.
88
92
89
93

94
+
Fig. 3. Number of requests per seconds.
90
95
91
96
In default state, automatic tuning is turned OFF on the database. You can press **Regression**
92
97
button to cause SQL plan choice regression in database layer. On the user interface will be shown decreased number of requests per seconds that can be served.
93
98
94
99

100
+
Fig. 4. Number of requests per seconds after regression.
95
101
96
102
If you refresh the page, the database state will be cleaned (i.e. query store and plan cache will be cleaned). You can turn on automatic tuning, wait some time to SQL Database analyze the workload and cause the regression again. You will notice that there is a regression that will be automatically corrected after some time. Pressing the **Regression** button again will not cause any regression.
0 commit comments