0% found this document useful (0 votes)
17 views

Client Side Performance Tracking

This document discusses enabling and retrieving client-side performance statistics from SQL connections. It explains that enabling statistics gathering has minimal performance impact and is useful for troubleshooting SQL Server and SQL Database performance issues. Key statistics returned include bytes sent/received, connection time, execution time, number of rows affected, and time spent on the network and server. Retrieving statistics involves opening a connection, executing a statement, and calling the RetrieveStatistics method.

Uploaded by

marlon_tayag
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Client Side Performance Tracking

This document discusses enabling and retrieving client-side performance statistics from SQL connections. It explains that enabling statistics gathering has minimal performance impact and is useful for troubleshooting SQL Server and SQL Database performance issues. Key statistics returned include bytes sent/received, connection time, execution time, number of rows affected, and time spent on the network and server. Retrieving statistics involves opening a connection, executing a statement, and calling the RetrieveStatistics method.

Uploaded by

marlon_tayag
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Client Side Performance Tracking

Client Statistics
Herve Roggero http://www.herveroggero.com [email protected]

Topics Covered
SqlConnection.StatisticsEnabled

Enabling client side statistics gathering Gather run-time statistics from statements Overview of the various statistics returned by SqlConnection

RetrieveStatistics

Understanding the statistics provided

When to use SqlConnection Statistics?


SQL Server/SQL Database performance issues

Are you waiting a lot on server resources? Network latency? SQL Profiler is not available for SQL Database Are you consuming too many rows? Too many roundtrips?

Gaining insights into SQL Database performance

Inspecting the behavior of your client application

Enabling Statistics
Open Connection to SQL Server or SQL Database

A connection must be established before enabling statistics Captures time spent on the server, plus the time spent by the provider Returns a collection of KeyValuePair containing the statistics

Execute Statement against the database

Call RetrieveStatistics

Enabling statistics has a minor impact on performance; use for troubleshooting only

A Few Statistics
Statistic BytesReceived BytesSent ConnectionTime ExecutionTime IduCount IduRows NetworkServerTime SelectRows ServerRoundTrips Comment Total bytes received from SQL Server/SQL Database Total bytes sent to SQL Server/SQL Database Total connection time since Statistics were enabled Total statement processing time (server and client) Number of Inserts, Deletes and Updates performed Number of rows affected by Inserts, Deletes and Updates Total time data provider waited for database responses Number of rows returned by SELECT statements Number of responses received from the database server

For a complete list of statistics, visit http://tinyurl.com/pqrzjod

You might also like