Comparison of five common mysqlslowlog analysis tools-MySQL

Source: Internet
Author: User
Mysqlslowlog is a log tool used to record SQL statements with a long execution time (beyond long_query_time seconds. you can enable slowlog in either of the following ways: 1. in cnf, log-slow-queries [file_name] 2 is used to specify the log mysql management tool when the mysqld process is started.

Mysql slow log is a log tool used to record SQL statements with a long execution time (beyond long_query_time seconds.

Enable slow log

There are two activation methods:

1. in my. cnf, log-slow-queries [= file_name]

2. when the mysqld process is started, specify the-log-slow-queries [= file_name] option

Comparison of five common tools

Mysqldumpslow, mysqlsla, myprofi, mysql-explain-slow-log, mysqllogfilter

Mysqldumpslow is the log analysis tool for slow query officially provided by mysql. The Output Chart is as follows:



The main function is to count slow SQL statements

Number of occurrences (Count ),

Maximum execution Time (Time ),

Total Time consumed ),

Lock ),

Total number of Rows sent to the client (Rows ),

Total number of Rows scanned (Rows ),

The user and the SQL statement itself (abstract the format, for example, limit 1, 20 is represented by limit N, N ).

Mysqlsla, a log analysis tool launched by hackmysql.com (This website also maintains mysqlreport, mysq1_xchk, and other useful mysql tools)



Data reports are very helpful for analyzing the causes of slow queries, including execution frequency, data volume, and query consumption.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.