MySQL Temp Table Statistics Test

In MySQL, a temporary table is a special type of table that allows you to store a temporary result set, which you can reuse several times in a single session. In some cases, the server creates internal temporary tables while processing statements. Users have no direct control over when this occurs. If an internal temporary table is created as an in-memory table but becomes too large, MySQL automatically converts it to an on-disk table. The maximum size for in-memory temporary tables is the minimum of the tmp_table_size and max_heap_table_size. If the result set gets bigger than this threshold, MySQL will overflow to-disk based temporary tables. When the size of on-disk temp tables increases beyond threshold, it can cause disk space exhaustion leading to server outages. Because of the continuous outages of the service, the user has to constantly restart the server leading to poor user experience. MySQL Temp Table Statistics Test helps administrators in this regard.

This test continuously tracks the total and maximum number of temporary tables created on disk and alerts administrators when the size of the on-disk temporary tables increases beyond the threshold. This way, administrators can be proactively alerted to increasing size of the on-disk temporary tables and initiate pre-emptive measures to avoid an impending server outage.

Target of the test : A MySQL server

Agent deploying the test : An internal/remote agent

Outputs of the test : One set of results for the target MySQL database server being monitored

 

Configurable parameters for the test
Parameter Description

Test period

This indicates how often should the test be executed.

Host

Specify the HOST for which this test is to be configured.

Port

Specify the port at which the target host is listening.

Database

Specify the name of a database on the target MySQL database server being monitored.

Username and Password

The eG agent has to be configured with the credentials of a user who has server-wide Process and Select privileges on the monitored MySQL server. To know how to create such a user, refer to Pre-requisites for Monitoring the MySQL Server topic.

Confirm Password

Confirm the password by retyping it here.

DD Row Count

By default, the detailed diagnosis of this test, if enabled, will report only the top-10 tables. This is why, the DD Row Count parameter is set to 10 by default. If you want to include more or less tables in detailed diagnosis, then change the value of this parameter accordingly.

Detailed Diagnosis

To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

  • The eG manager license should allow the detailed diagnosis capability
  • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Total temp tables created on disk

Indicates the total number of temp tables created on disk during the last measurement period.

Number

 

Maximum temp tables created on disk

Indicates the maximum number of internal on-disk temporary tables created by the server while executing statements.

Number

The detailed diagnosis of this measure lists the Thread ID, Statement ID, Schema name, Query duration, Table lock wait time (Seconds), Temp disk tables created, Temp tables created, Rows sent, Rows examined, Select scan, Sort scan and SQL text.