1.61 SQL Statistics

The SQL Statistics object in the Microsoft SQL Server provides counters to monitor compilation and the type of requests sent to an instance of the SQL Server. Monitoring the number of query compilations and recompilations and the number of batches received by an instance of the SQL Server indicates how quickly the SQL Server is processing user queries and how effectively the query optimizer is processing the queries.

1.61.1 For Microsoft SQL Server 2008/2012/2014/2016

Default Collection Interval — Every 10 minutes

Table 1-71 SQL Statistics Metrics

Metric Description

SQL Statistics Counter Name (key column)

Performance metric name. See Table 1-72.

SQL Statistics Counter Value (key column)

Performance metric value.

The SQL Statistics Counter Name key column contains several metrics. Table 1-72 provides a list of these metrics and a description for each.

Table 1-72 SQL Statistics Counter Name Metrics

Metric Description

Auto-Param Attempts/sec

Number of auto-parameterization attempts per second. Total should be the sum of the failed, safe, and unsafe auto-parameterizations. Auto-parameterization occurs when the SQL Server attempts to reuse a cached plan for a previously executed query that is similar as the current query, but not exactly the same. For more information, see "Auto-parameterization" in the Microsoft SQL Server Introduction.

Batch Requests/sec

Number of Transact-SQL command batches received per second. This statistic is affected by all constraints (such as I/O, number of users, cache size, complexity of requests, and so forth). High batch requests mean good throughput. For more information, see "Batch Processing" in the Microsoft SQL Server Introduction.

Safe Auto-Params/sec

Number of safe auto-parameterization attempts per second.

SQL Compilations/sec

Number of SQL compilations per second. Indicates the number of times the compile code path is entered. Includes compiles due to recompiles. After SQL Server user activity is stable, this value should reach a steady state.

SQL Recompilations/sec

Number of SQL recompiles per second. Counts the number of times recompiles are triggered. Generally, the number of recompiles should be low.

Unsafe Auto-Params/sec

Number of unsafe auto-parameterization attempts per second. The table has characteristics that prevent the cached plan from being shared. These are designated as unsafe. The fewer of these that occur the better.