Wartość procentowa pełnych skanów tabel wykonanych na serwerze MySQL. Pełne skanowanie tabeli ma miejsce, gdy serwer sekwencyjnie sprawdza każdy wiersz tabeli względem warunku. Pełne skany tabel mogą często występować dla tabel z małą liczbą wierszy. Próg monitora jest analizowany w odniesieniu do średnich wartości zwracanych w sondach do agenta, gdzie parametr Liczba próbek określa liczbę próbek uwzględnionych podczas obliczania średniej.
Zła kondycja oznacza, że wartość procentowa pełnych skanów tabel jest wysoka. Pełne skany tabel mogą występować dla tabel o liczbie wierszy mniejszej niż 10 lub dla tabel z krótkimi wierszami. Mogą także występować w trakcie porównywania kolumn zindeksowanych zawierających stałe wartości.
Aby rozwiązać problem związany ze zbyt dużą wartością procentową skanów tabel, wykonaj następujące czynności:
Zoptymalizuj zapytanie MySQL, które powoduje pełne skanowanie tabel
Użyj polecenia „ANALYZE TABLE nazwa_tabeli” serwera MySQL, aby zaktualizować dystrybucje kluczy
Użyj opcji serwera MySQL w poleceniu „FORCE INDEX”, aby ręcznie zrezygnować z optymalizatora MySQL dla danego indeksu
Zmień wartość zmiennej max_seeks_for_key na taką, która pozwoli na przeprowadzenie wyszukiwań w celu pobierania danych.
Konfiguracja domyślna
Parametr | Wartość domyślna |
Próg ostrzeżenia | Większy niż 80 |
Próg błędu | Większy niż 95 |
Liczba próbek | 3 |
W celu zmiany wartości parametrów zdefiniowanych powyżej dla wszystkich lub określonych wystąpień bądź grup można zastosować zastąpienia.
Target | Microsoft.MySQLServer.ManagedServer.Unix | ||
Parent Monitor | Microsoft.MySQLServer.RowOperationsPerformanceRollup | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.Oss.WSManEnumeration.GreaterThanThreshold.ThreeState.MonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.MySQLServer.ManagedServer.Unix.FullTableScanPct.Monitor" Accessibility="Public" Target="Microsoft.MySQLServer.ManagedServer.Unix" TypeID="Oss!Microsoft.Oss.WSManEnumeration.GreaterThanThreshold.ThreeState.MonitorType" Enabled="onStandardMonitoring" ParentMonitorID="Microsoft.MySQLServer.RowOperationsPerformanceRollup">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.MySQLServer.ManagedServer.Unix.FullTableScanPct.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Value$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="StatusOK" ID="UnderThreshold"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="StatusWarning" ID="OverWarningThreshold"/>
<OperationalState HealthState="Error" MonitorTypeStateID="StatusError" ID="OverErrorThreshold"/>
</OperationalStates>
<Configuration>
<Interval>300</Interval>
<TargetSystem>$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<Uri>http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/MySQL_ServerStatistics?__cimnamespace=root/mysql</Uri>
<WSManFilter/>
<ObjectName>MySQL Server</ObjectName>
<CounterName>Full Table Scan Pct</CounterName>
<InstanceXPath>/DataItem/WsManData/*[local-name(.)='MySQL_ServerStatistics']/*[local-name(.)='InstanceID']</InstanceXPath>
<InstanceName>$Target/Property[Type="Microsoft.MySQLServer.Installation"]/InstanceID$</InstanceName>
<Value>$Data/WsManData/*[local-name(.)='MySQL_ServerStatistics']/*[local-name(.)='FullTableScanPct']$</Value>
<WarningThreshold>80</WarningThreshold>
<ErrorThreshold>95</ErrorThreshold>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>