dotTrace Help

SQL Client

The SQL Client 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 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:

  • SQLClient
  • OLE DB*
  • Entity Framework
  • ODBC*

Select the SQL Client 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 Client filter to determine the slowest queries and methods that run these queries.

When the SQL Client event is selected, the Filters window contains sub-filters that allow you to refine the resulting filter: SQL Client: Command and SQL Client: Connection String.

SQL Client: Command

The SQL Client: 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 or query take.

sql_client_command_1

pos_1 Command name or query content.

pos_2 Total time spent on a SQL command summed up for all selected threads.

pos_3 The percentage of time spent on a SQL command relative to the total selected time.

To apply the SQL Client: 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_client_command_2

SQL Queries Window

If a query is too long to fit the Filters window, it is truncated by width. To view the entire content of such a query, open the SQL Queries window. The window shows the same data as the SQL Client: Command filter but in addition, it allows finding queries by content and copying the content to clipboard.

sql_queries

To open the sql queries window:

  • Do one of the following:
    • Use the menu View | SQL Queries.
    • Click the sql_queries_open_button button in the SQL Client: Command filter.

As well as the SQL Client: Command filter, the SQL Queries window also can work as a filter by a SQL command.

To apply the filter by a particular command (query):

  • Do one of the following:
    • Double-click on the desired SQL command.
    • Select the desired SQL command and press Enter
    • In the context menu of the desired SQL command, choose Select And Clear Others.

To apply the filter by a number of commands (queries):

  • Do one of the following:
    • Select the desired SQL command and press Space.
    • In the context menu of the desired SQL command, choose Select As Filter.
    This will add the SQL command to selection.

To copy query content to the clipboard:

  • In the context menu of the desired SQL query, choose Copy To Clipboard.

To find a particular SQL command (query) by content:

  • In the search text box located on top of the SQL Queries window, start typing command (query) content you are looking for. As you type, the list of SQL commands narrows down, suggesting the ones that match the entered string.

For convenience, large queries consisting of multiple rows are truncated.

To see the full content of a truncated query:

  • Do one of the following:
    • Click the ... button in the end of the query.
    • In the context menu of the desired SQL query, choose Show Full Query.

SQL Client: Connection String

The SQL Client: Connection String sub-filter shows distribution of SQL Client time between SQL sessions with particular connection parameters. This filter could be useful, for example, if your application communicates with more than one SQL server.

sql_client_connection_string_1

pos_1 Connection string.

pos_2 Total time of all SQL sessions with these connection parameters.

pos_3 The percentage of time spent in SQL sessions with these connection parameters relative to the total selected time.

To apply the SQL Client: 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 sessions with corresponding connection parameters.

sql_client_connection_string_2
Last modified: 1 November 2015