Mysql Mysqldumpslow
shell> mysqldumpslow log_file

mysqldumpslow tries to determine when queries are similar and can be grouped. For example, the following two queries fit the same pattern because they differ only in the data values:

SELECT * FROM t WHERE id = 'H7XQ19' AND AGE < 10;
SELECT * FROM t WHERE id = 'J8MZ48' AND age < 20;

mysqldumpslow groups those queries and reports them in its summary output using a "template" that looks like this:

SELECT * FROM t WHERE id = 'S' AND age < N;

Here 'S' and 'N' indicate where the query contains string and numeric data values, respectively.

Along with each query, mysqldumpslow shows the number of times it appears in the log, the user who issued it, and some execution time information.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License