| title | Enable Query Performance Insight Dashboard | Microsoft Docs |
|---|---|
| description | This sample describes the article in 115 to 145 characters. Validate using Gauntlet toolbar check icon. Use SEO kind of action verbs here. |
| keywords | |
| ms.custom | tools|sos |
| ms.date | 11/01/2017 |
| ms.prod | sql-non-specified |
| ms.reviewer | alayu; erickang; sanagama; sstein |
| ms.suite | sql |
| ms.tgt_pltfrm | |
| ms.topic | tutorial |
| author | erickangMSFT |
| ms.author | erickang |
| manager | craigg |
| ms.workload | Inactive |
In this tutorial, we will walk-through how to enable an insight widget on Dashboard to get an at-a-glance view about the top five slowest queries using Query Data Store. We will futher examine how to view the details of the slow queries and query plans using Carbon's features. After following through this tutorial, you will learn learn how to:
[!div class="checklist"]
- Enable Query Data Store on TutorialDB
- Quickly turn on an insight widget using a built-in insight widget sample.
- View the details of the top five slowest query.
- Open the query script in editor.
- View query plans.
-
Follow Get Started with Carbon to a SQL Server 2017 instance and TutorialDB database.
-
Enable Query Data Store by executing following T-SQL statement on TutorialDB:
ALTER DATABASE TutorialDB SET QUERY_STORE = ON
Carbon has a built-in sample widget to monitor the top five slowest query using query performance information. The performance information is collected by Query Data Store. With a few simple steps, you can easily visualize and use the information to improve your database and application.
-
Open User Settings by pressing 'F1' to open Command Palette, type in 'settings' in the command search input box and select 'Preferences: Open User Settings' command.
-
Type 'dashboard' in Settings Search input box to search "dashboard.database.widgets" in Settings.
-
Click 'Copy to Settings' to copy "dashboard.database.widgets" settings to customize.
-
Using Carbon's insight settings IntelliSense, configure 'name' for the widget title, 'gridItemConfig' for the widget size, and 'widget' by selecting 'query-data-store-database-insight' from the drop down list as shown in the screenshot below:
-
Press 'CTRL + s' to save the user's settings file.
-
Open Database dashboard by navigate to 'TutorialDB' in Servers viewlet, and click 'Manage' in the context menu.
-
View 'Top five slowest query insight graph' as shown in the screen shot below:
-
Click 'Show Insight' context menu. It will open Inishgts detail dialog as shown in the screenshot:
-
Click any item in 'Chart Data' list to show more detail of each item in the list.
-
Select 'query_sql_txt' field in 'Query Data' panel and click 'Copy Selection'.
-
Open a new editor by pressing 'CTRL + N'.
-
Paste the query sql text by pressing 'CTRL + V' in the editor.
-
Click 'Explain' button.
-
View the showplan.
-
Open the insight detail dialog again.
-
Select and copy 'query_plan'
-
Press 'CTRL+N' to open a new editor.
-
Paste the copied plan data to the editor.
-
Press 'CTL + S' to save the file and change the file extension to *.showplan
-
The query plan opens in Carbon's query plan viewer.
TBD - screenshot after fixing bug in Carbon.
In this tutorial, you learned how to:
[!div class="checklist"]
- Enable Query Data Store on TutorialDB
- Quickly turn on an insight widget using a built-in insight widget sample.
- View the details of the top five slowest query.
- Open the query script in editor.
- View query plans.
Next, learn how to use X, try this tutorial:
[!div class="nextstepaction"] What article is next in sequence








