Capturing data is a critical part of performing a query analysis, or even just to have an idea of what’s going on inside the database.
There are several known ways to achieve this. For example:
- Enable the General Log
- Use the Slow Log with long_query_time = 0
- Capture packets that go to MySQL from the network stream using TCPDUMP
- Use the pt-query-digest with the –processlist parameter
However, these methods can add significant overhead and might even have negative performance consequences, such as:…[Read more]