Need information on Latency on Query analytics

Hello Experts,

I am MS SQL Developer and new to MySQL. I came across Percona Monitoring and Management tool → Query Analytics. There is a column called “Latency” and “Load”. Can any experts explain me this please?

Regards,
Naveen

Hi naveenjv,

Query Analytics joins statistics for similar queries into query class.
we have several metrics for each query class:
[LIST]
[]query_time_sum - summary of all query times for class
[
]query_time_max - maximal query times for class
[]query_time_avg - average query times for class
[
]query_time_min - minimal query times for class
[/LIST]
So, in Query Analytics interface you can see the following values:

Load = SUM(query_time_sum) / time_range
Latency Max = MAX(query_time_max)
Latency Avg = AVG(query_time_avg)
Latency Min = MIN(query_time_min)

Thanks Mykola for the information. But I am not clear what does ‘query class’ means?

I have an update Mysql query which takes around 0.002 secs if I execute directly in MySQL window, but Query analytics windows show latency as 3.02 secs.
What does this actually means? Do I need to ignore this or need to take some preventive actions?

Also, I have one select query which shows up Load as ‘1.49 k (16.02%)’, how do I interpret this?

Thanks in advance.
Naveen J V

Hi naveenjv,

application can run very many queries, but usually these queries has difference only in passed data.
for example database can receive billions queries like the following

SELECT value FROM table WHERE key=?

each request will have unique key (instead of “?”), so all of queries are unique,
But it is only one query class because difference is only in passed data.

it is maximal query time for query class. It means that this query sometimes can be very-very slow.

is means that you database 16.02% of time works only on this query class.
if you optimize this query you can decrease db load up to 15%