how to calculate a query's frequency ? I doubt that some query is very often,I want to know its pqs,can any body tell me ? I have tried using general log,is there any tool to figure out ?


Plan A: Turn on the "general log" and use pt-query-digest to analyze the log.

Plan B: Set long_query_time = 0 and turn on the slowlog. Then use pt-query-digest to analyze the log.

Caution: In either case, disk will fill up fast.

With the slowlog you get a lot of other information -- useful if you are concerned about what is bogging down the system. That is a different question than 'frequency'; it is frequency * avg execution time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.