[QAN] Chronological sort

Pretty simply, after setting Browser time to last 5 minutes, how does one set the sort order of Queries to chronological order.

Hi @nycgags.
Query Analytics in PMM is not a “logging” or “real-time” tool.
The main goal is to provide visibility on resources by already executed queries.

You can see in QAN what queries weren’t executed last minute

But it’s still not a very chronological one.

Can you please provide more details about your use case and the problem you are trying to solve? I would love to hear about it and see if PMM can help solve the problem.

I was given the following instructions:

“Hi John this page seems slow to load, can you find out why?”

If I was using MSFT SQL Server I would launch Profiler and see exactly what was being executed against the server in real time. With MySQL I am at a loss.

Hi @nycgags
This solution might not provide you with chronological sort in QAN but could help you troubleshoot the slow load issue.

Enable slow logs by setting
long_query_time - max seconds after which slow queries should be logged
slow_query_log - ON
slow_query_log_file - file name

Once that is done, you can test the application so that slow query logs are generated.

To analyze slow query logs you can then use pt-query-digest with the timeframe for which the application was tested.

pt-query-digest --since '2024-01-01 12:00:00' --until '2024-01-01 12:30:00'  mysql-slow_log_file_name.log  > output.txt

More about slow query logs here - https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html
More about pt-query-digest here - pt-query-digest — Percona Toolkit Documentation