How to analyze SQL queries on a MySQL server with Percona Toolkit | ASSIST Software Romania
get in touch
>

LIKE

SHARE

Facebook Share Tweet LinkedIn Share

FOLLOW

LinkedIn Follow Xing Follow

CTO at ASSIST

If you need to see what queries are performed by a MySQL database you can use New Relic service or use MySQL tools like Percona Toolkit. For general queries they’ll make a top of most used queries. 
 

1. First step is to activate general queries log with mysql command:

SET GLOBAL general_log = ‘ON; 

Attention: enable general queries log only for a couple of minutes, this can affect performance on a production server.

2. Process log with pt-query-digest from Percona Toolkit[1]. Command to generate a top of most used queries:

pt-query-digest --group-by distill --type genlog general.log  > general_group.log

[1]. http://www.percona.com/doc/percona-toolkit/2.2/pt-query-digest.html

Querydigest image

Do you want to get in touch with us? 

If you are interested in our software development services, you would like to join our team, or you simply want to find out more about us, we’d love to hear from you! Drop us a line and a member of the ASSIST team will get back to you as soon as possible. We are sure we can ASSIST you.

GET IN TOUCH