Skip to content

Commit 4160c2b

Browse files
authored
Merge pull request microsoft#128 from Microsoft/pmasl-patch-9
Create README.md
2 parents c837014 + 0a73e47 commit 4160c2b

File tree

1 file changed

+18
-0
lines changed
  • samples/demos/mssqltiger/Plan-Comparison/Inside-Query-Store

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
The plan comparison tool is used inside Query Store UI to allow plan comparison.
2+
3+
###Prerequisites
4+
Restore QueryStoreTest database from provided .bacpac (/Databases/Import Data-tier application).
5+
6+
###Query with plan regression
7+
1. Run QueryStoreSimpleDemo.exe with option R
8+
2. Open SSMS, and under QueryStoreTest database, expand Query Store.
9+
3. Open the *Top Resource Consuming Queries* report.
10+
4. For query id 1 there are two execution plans that SQL Server use alternately (switches between 2 plan almost randomly).
11+
5. Select one of the plans in the right pane, and while holding the Shift key, select the other plan.
12+
6. On the top ribbon in the same pane, click on *Compare the plans for the selected query in a seperate window* - this brings up Plan Comparison.
13+
7. In the *Properties* window you are able to spot some differences in the SELECT node. Expand the *Parameter List* and observe how the *Parameter Compiled Value* is different on both plans.
14+
This is known as Parameter Sniffing problem - plan gets generated based on parameter available at the compilation time.
15+
When compilation happens frequently and randomly and data is skewed (not all parameter values are uniformly distributed).
16+
17+
Knowing the cause, you can chose to force the perceived better plan for most use cases.
18+
This can fix performance quickly and is fully transparent to running apps.

0 commit comments

Comments
 (0)