Auto Create Statistics Configuration

Microsoft.SQLServer.2008.Database.Configuration.AutoCreateStat (UnitMonitor)

Monitors the auto create statistic setting for the database

Knowledge Base article:

Summary

This monitor checks the Auto Create Statistics setting for this database. Since this monitor is a part of an overall standards requirement, an alert would be generated if the setting does not meet the specified standard.

The query optimizer needs up-to-date and accurate statistics in order to generate good plans. In most cases, it’s best to let SQL Server maintain the statistics. If you turn “Auto Create Stats” and “Auto Update Stats”, then it is up to you to keep the statistics up-to-date somehow. Failure to do so will lead to poor query performance. Most applications should have these options ON.

Configuration

When the Auto Create statistics setting is ON, the query optimizer creates statistics on one or more columns of a table of indexed view, as necessary, to improve query plans and query performance.

AUTO_CREATE_STATISTICS {ON | OFF}

Causes

A warning alert will be raised if the option does not match the required setting. Out of the box, the monitor is configured to alert when this setting is set to “OFF”.

Resolutions

This issue may be resolved by:

Alternatively, if this monitor is not of concern for this database:

External

See more detailed information about this setting: ALTER DATABASE SET Options (Transact-SQL)

See also “ Using Statistics to Improve Query Performance

Overrideable Parameters

Name

Description

Default Value

Alert Priority

Defines Alert Priority.

Normal

Alert Severity

Defines Alert Severity.

Warning

Disable Check for SQL Express

Enables or disables check for SQL Express version.

No

Enabled

Enables or disables the workflow.

No

Expected Value

To view the set of possible values, see "Configuration" section in the knowledge of this monitor.

ON

Generates Alerts

Defines whether the workflow generates an Alert.

Yes

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

43200

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

TargetMicrosoft.SQLServer.2008.Database
Parent MonitorMicrosoft.SQLServer.2008.Database.AutomaticConfiguration
CategoryConfigurationHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2008.DBConfigurationStatus
RemotableTrue
AccessibilityPublic
Alert Message
Auto Create Statistics Configuration Error
The auto create statistics setting for database "{0}" in SQL instance "{1}" on computer "{2}" is not set according to best practice.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.Database.Configuration.AutoCreateStat" Accessibility="Public" Enabled="false" Target="SQL2008Core!Microsoft.SQLServer.2008.Database" ParentMonitorID="Microsoft.SQLServer.2008.Database.AutomaticConfiguration" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.DBConfigurationStatus" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.Database.Configuration.AutoCreateStat.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ConfigurationValueOK" MonitorTypeStateID="ConfigurationValueOK" HealthState="Success"/>
<OperationalState ID="ConfigurationValueNotOK" MonitorTypeStateID="ConfigurationValueNotOK" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
<ConfigValue>AutoCreateStat</ConfigValue>
<ExpectedValue>ON</ExpectedValue>
<ExcludeOnExpress>false</ExcludeOnExpress>
<SQLSKU>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Edition$</SQLSKU>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>