2.4.8 DBMS Monitoring : Table

Size information

image 2022 12 28 15 07 18 028

Check the information of the entire table.

Size information by schema

image 2022 12 28 15 07 57 373

View detailed information by schema.

Number of tables by schema

image 2022 12 28 15 09 00 250

Check the engine information and number of tables by schema.

Tables without PK

image 2022 12 28 15 09 58 548

Check the number of tables without PKs.

Table without Index

image 2022 12 28 15 10 44 708

Notice that there are no indexes on the table.

Table where PK is not a numeric type

image 2022 12 28 15 11 40 088

Check the table information for non-numeric types.

Snapshot of a table with Index larger than Data

image 2023 02 07 15 12 42 532

Fullscan ratio

image 2022 12 28 15 12 42 532

MySQL’s full-scan ratio indicates the percentage of times the database server scans the entire table instead of using indexes to retrieve data. A high full scan ratio indicates that the database is not using indexes efficiently, resulting in slow query performance.

To minimize the overall scan ratio, we recommend creating indexes on frequently used columns and building queries using the indexes. Optimizing indexes can significantly improve query performance because the database server can quickly find the desired data in the index instead of searching the entire table.

The parameter information used is shown below.

  • SELECT_FULL_JOIN

  • Calculation (HANDLER_READ_RND_NEXT + HANDLER_READ_RND) / (HANDLER_READ_RND_NEXT + HANDLER_READ_RND + HANDLER_READ_FIRST + HANDLER_READ_NEXT + HANDLER_READ_KEY + HANDLER_READ_PREV) * 100.0");

Lock wait count

image 2022 12 28 15 29 24 006

Immediate and waited are two performance metrics in the MySQL performance schema that show the number of table lock requests that are immediately authorized and the number of table lock requests that must wait to be unlocked, respectively.

IMMEDIATE reflects the number of lock requests that were immediately granted because the table was not locked or the lock was immediately available. This metric indicates the performance of the locking mechanism and the overall load on the server. A large number of immediate lock grants can indicate a well-tuned server that handles a large number of requests.

On the other hand, waited reflects the number of lock requests that have to wait for a lock to be released. This metric can indicate the presence of lock contention, where multiple queries are trying to access the same table at the same time and one must wait for the others to complete. A high value of waited can be an indicator of poor performance and may indicate that the database is not optimized for high concurrent usage.

In summary, these two metrics provide important information about the performance of MySQL’s locking mechanism and can be used to identify potential bottlenecks or problems in the system.

The parameter information used is shown below.

  • TABLE_LOCKS_IMMEDIATE: Number of table locks acquired immediately.

  • TABLE_LOCKS_WAITED: Number of table locks waited for.

Tmp Disk Utilization

image 2022 12 28 15 31 55 782

The tmp disk percentage in MySQL indicates the percentage of disk space used for temporary storage compared to the total disk space available to the database server. This temporary storage is used to store intermediate results during complex queries and is also used to sort and group data.

CREATED_TMP_TABLES is a performance metric in MySQL that indicates the number of temporary tables created on disk rather than in memory. The value of this metric is an indicator of how much temporary disk space the MySQL server is using. A high value for CREATED_TMP_TABLES indicates that the MySQL server is running out of memory and needs to use temporary disk space to store temporary tables.

The parameter information used is shown below.

  • CREATED_TMP_TABLES: The number of temporary tables created in memory.

  • Calculation CREATED_TMP_TABLES / QUERIES * 100

Metadata lock

image 2022 12 28 15 39 44 712

Record lock

image 2022 12 28 15 40 51 327