Unable to get query in Query Analytics (MYSQL) taking time more than 5min

Hi, I am unable to get few query in Query Analytics. I have created a script which calculates the bad query and in results gives the querry taking more than 5 minutes, but in PMM those query were supposed to be QAN. I want those queries to be displayed in QAN. For better understanding i have attached the ScreenShots.

1 Like

Hi @sawan_singh,

Thank you for being an active part of the community.
Could you execute the following command on the database server:

pmm-admin status

This should tell us if the slow log agent is running.
Also check the following variables:

show global variables like '%slow%';
show global variables like 'long%';
show global variables like 'log_queries%';

This will tell us your slow log configuration.

Post this information back here and we will try to find out what’s happening.

Thank you!


1 Like

Thanks For replying @Pep_Pla
I have ran these queries, below attached Snapshots were the output of the query you to run.
Thank You
show global variables like ‘%slow%’;

show global variables like ‘long%’;

show global variables like ‘log_queries%’;

1 Like

Hi, this is still missing:

Looks like the Slow Query Log is not enabled. We need to make sure that the Performance schema is enabled and configured:

From the PMM documentation, the following should be enabled. Could you share with us the value of these variables?

Variable Value Description
performance_schema ON Enables Performance Schema metrics. This is the default in MySQL 5.6.6 and higher.
performance-schema-instrument ‘statement/%=ON’ Configures Performance Schema instruments.
performance-schema-consumer-statements-digest ON Configures the statements-digest consumer.
innodb_monitor_enable all Enables InnoDB metrics counters.

Also, check that the PMM user has the process privilege. Use show grants for <pmm-user>;



1 Like