O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Analyzing slow queries using pt-query-digest

pt-query-digest, which is part of the Percona Toolkit, is used for analyzing queries. The queries can be collected through any of the following:

  • Slow query log
  • General query log
  • Process list
  • Binary log
  • TCP dump

Installation of the Percona Toolkit is covered in Chapter 10Table Maintenance, Installing Percona Toolkit section. In this section, you will learn how to use pt-query-digest. There are drawbacks for each method. The slow query log does not include all queries unless you specify long_query_time as 0, which drastically slows down a system. The general query log does not include query time. You cannot get complete queries from the process list. Only writes can be analyzed using binary log ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required