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!

Pep

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
Sawan
show global variables like ‘%slow%’;

show global variables like ‘long%’;
image_2022_11_23T10_43_00_049Z

show global variables like ‘log_queries%’;
image_2022_11_23T10_43_35_986Z

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>;

Thanks,

Pep

1 Like

hi @Pep_Pla hope you are doing well,
pmm-admin status (output of the command)


we are using AWS RDS for mysql.
performance_schema is off

grants for the user we have used
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON .
Thanks,
Sawan

1 Like