SQL Queries
The SQL Queries event is used to indicate time intervals where your application communicates with an SQL server. This includes time required for opening and closing connections, running commands, performing queries, and other SQL activities. Note that all measurements are performed on the client side - dotTrace measures the time between a client sending a request and it receiving a response.
dotTrace collects SQL data from the following data providers:
Select the SQL Queries event to analyze how your app accesses data. For example, a web application may run slow due to a bottleneck in SQL server communication. In such a case, you can use the SQL Queries filter to determine the slowest queries and methods that run these queries.
When the SQL Queries event is selected, the Filters window contains sub-filters that allow you to refine the resulting filter: SQL Queries: Command and SQL Queries: Connection String.
SQL Queries: Command
The SQL Queries: Command sub-filter shows distribution of SQL operations time between SQL commands: queries, opening and closing connection commands, and so on. Use this sub-filter to determine how much time does a particular command take.
Command name or query content.
Total time spent on a SQL command summed up for all selected threads.
The percentage of time spent on a SQL command relative to the total selected time.
To apply the SQL Queries: Command filter:
- Check the desired SQL command in the filter.
After you select a command, other filters will show data only for the time intervals where the selected command was performed.
SQL Queries Window
If a command content is too long to fit the Filters window, it is truncated by width. To view the entire content of such a command, open the SQL Queries window. The window shows the same data as the SQL Queries: Command filter but, in addition, it allows finding commands by content and copying the content to clipboard.
To open the SQL Queries window:
As well as the SQL Queries: Command filter, the SQL Queries window also can work as a filter by an SQL command.
To apply the filter by a particular command (query):
To apply the filter by a number of commands (queries):
To copy command content to the clipboard:
To find a particular SQL command (query) by content:
For convenience, large commands consisting of multiple rows are truncated.
To see the full content of a truncated command:
SQL Queries: Connection String
The SQL Queries: Connection String sub-filter shows distribution of SQL Queries time between SQL commands with particular connection parameters. This filter could be useful, for example, if your application communicates with more than one SQL server.
Connection string.
Total time of all SQL commands with these connection parameters.
The percentage of time spent running SQL commands with these connection parameters relative to the total selected time.
To apply the SQL Queries: Connection String filter:
- Check the desired string in the filter.
After you select a connection string, other filters will show data only for the time intervals where threads run SQL commands with corresponding connection parameters.