The following articles mainly describe how to analyze Mysql mysqlsla in Linux. We use the relevant code to get the correct operation of Mysql mysqlsla in Linux, the following is an introduction to the specific content of the article. I hope you will have a better understanding of it after browsing.
- tar zxvf mysqlsla-2.03.tar.gz
- cp mysqlsla-2.03/bin/mysqlsla /usr/local/bin
If the message "Can't locate DBI. pm" is displayed, run the following command:
- yum install perl-DBI perl-DBD-MySQL -y
In this case, you can use mysqlsla. The usage is as follows:
- mysqlsla -lt slow slow.log
- mysqlsla
Mysql mysqlsla: as a whole, Mysql has powerful functions. Data reports are very helpful for analyzing the causes of slow queries, including execution frequency, data volume, and query consumption.
The format is described as follows:
Total number of queries (queries total), number of SQL statements after deduplication (unique)
Sorted)
The most important slow SQL statement statistics, including average execution time, lock wait time, total number of result rows, and total number of scanned rows.
Count, the number of SQL executions and percentage of the total slow log Count.
Time, execution Time, including the total Time, average Time, minimum, maximum Time, and Time as a percentage of the total slow SQL Time.
95% of Time removes the fastest and slowest SQL statements, and the SQL Execution Time with a coverage rate of 95%.
Lock Time, the waiting Time.
95% of Lock, 95% of slow SQL wait Lock time.
Rows sent, the number of result Rows, including average, minimum, and maximum.
Rows examined: number of Rows scanned.
Database, which Database belongs
Users, which user and IP address account for the percentage of SQL statements executed by all Users
Query abstract: abstract SQL statement
Query sample, SQL statement
The above content is the description of Mysql mysqlsla Analysis in Linux, hoping to help you in this regard.