哈希桶中行链的平均长度

Microsoft.SQLServer.Linux.Monitor.DBFilegroupFx.HashIndexAvgChainLength (UnitMonitor)

此监视器检查 SQL 数据库中哈希索引空桶计数和行链的平均长度。

Knowledge Base article:

摘要

此监视器检查此数据库中表的哈希桶中行链的平均长度。由于此监视器是整体标准要求的一部分,如果该设置不符合指定的标准,将生成警报。

配置

这些索引用于高效地访问 SQL Server 表中的数据。指定正确的索引可极大地提高查询性能。如果 empty_bucket_percent 大于空桶百分比阈值,avg_chain_length 大于平均链长阈值,监视器将引发警告警报,因为有太多重复项,使用非聚集索引会更加合适。

外部

请参阅详细信息:

Indexes for Memory-Optimized Tables(内存优化表的索引)

可替代参数

名称

说明

默认值

警报优先级

定义警报优先级。

正常

警报严重性

定义警报严重性。

警告

平均链长度阈值

平均链长度阈值,表示哈希桶中行链的平均长度。

100

显示索引计数

根据最佳做法未配置索引的显示计数。

5

空桶百分比阈值

空桶百分比阈值,表示哈希索引中的空桶数。

10

启用

启用或禁用工作流。

生成警报

定义工作流是否生成警报。

间隔(秒)

运行工作流的重复间隔时间(秒)。

43200

同步时间

使用 24 小时格式指定的同步时间。可以忽略。

 

超时(秒)

指定工作流在关闭之前允许运行的时间,并标记为失败。

300

数据库连接超时(秒)

如果在指定期间无法访问数据库,工作流将失败并注册一个事件。

15

Element properties:

TargetMicrosoft.SQLServer.Linux.DBFilegroupFx
Parent MonitorSystem.Health.ConfigurationState
CategoryConfigurationHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Linux.MonitorType.DBFilegroupFx.HashIndexAvgChainLength
RemotableTrue
AccessibilityPublic
Alert Message
Linux 上的 MSSQL: 哈希桶中行链的平均长度错误
在计算机“{2}”上 SQL 实例“{1}”中的数据库“{0}”包含的表中,索引包含太多重复项,使用非聚集索引会更加合适。{3}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Linux.Monitor.DBFilegroupFx.HashIndexAvgChainLength" Accessibility="Public" Enabled="true" Target="SqlDiscL!Microsoft.SQLServer.Linux.DBFilegroupFx" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Linux.MonitorType.DBFilegroupFx.HashIndexAvgChainLength" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Linux.Monitor.DBFilegroupFx.HashIndexAvgChainLength.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</AlertParameter1>
<AlertParameter2>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='Status']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Health" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<InstanceName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<DatabaseName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<EmptyBucketPercentThreshold>10</EmptyBucketPercentThreshold>
<AvgChainLengthThreshold>100</AvgChainLengthThreshold>
<ErrorTopLines>5</ErrorTopLines>
</Configuration>
</UnitMonitor>