mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Updated FLGP demo
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 272 KiB After Width: | Height: | Size: 271 KiB |
@@ -66,7 +66,11 @@ Open demo-full.sql and follow the comments in the code.
|
||||
correction script is in the view
|
||||
- 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**
|
||||
|
||||
 
|
||||

|
||||
Fig. 1. Optimal plan with "Hash Aggregate".
|
||||
|
||||

|
||||
Fig. 2. Regressed plan with "Stream Aggregate".
|
||||
|
||||
- Take the script from the `sys.dm_db_tuning_recommendations` view and force the recommended plan.
|
||||
- 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
|
||||
last 10 T-SQL request durations, and displays how many requests per second can be executed.
|
||||
|
||||

|
||||
Fig. 3. Number of requests per seconds.
|
||||
|
||||
In default state, automatic tuning is turned OFF on the database. You can press **Regression**
|
||||
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.
|
||||
|
||||

|
||||
Fig. 4. Number of requests per seconds after regression.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
body {
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
}
|
||||
</style>
|
||||
<link href="media/bootstrap.min.css" rel="stylesheet" />
|
||||
|
||||
Reference in New Issue
Block a user