Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use pt-query-digest slow query Analysis tool

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to use the pt-query-digest slow query analysis tool, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

1. The installation process is omitted because a previous dba has installed pt-query-digest on the server

Mainly describe how to use it

1. Locate the installation directory

You can use find /-name pt-query-digest or find /-name pt-query

Find the path at / usr/bin

Then enter the slow query log directory

Cd / var/log/mysql

[root@hs-dba-1 mysql] # ll

Total 732888

-rw-r--r-- 1 root root 31621 Mar 20 11:14 digest.log

-rw-rw---- 1 mysql mysql 16909390 Mar 20 10:19 mysql_error.log

-rw-r- 1 mysql mysql 16384 Dec 12 09:37 mysql_error.log_bak

-rw-rw---- 1 mysql mysql 559719 Mar 20 13:37 slow-query.log

-rw-r- 1 mysql mysql 1457 Nov 2618: 20 slowquery.log_20162618

-rwxrwxrwx 1 mysql mysql 1 Mar 14 16:58 slowquery.log_bak

-rw-r- 1 mysql mysql 732930070 Jan 3 17:53 slowquery.log_bak_20170103

You can see the slow query log slow-query.log

Then use the command

/ usr/bin/pt-query-digest slow-query.log > digest.log

Generate digest.log files in the current directory

Thank you for reading this article carefully. I hope the article "how to use pt-query-digest slow query Analysis tool" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report