Reputation: 1563
I want to get a list of queries executed against my mysql instance, I also want to get list of executions counts for them and duration,
I can get these stats in something like datadog APM, but I would like to be able to run a query for them locally.
is there a table or schema I need to look at?
Upvotes: 0
Views: 163
Reputation: 142306
Turn on the "general log" and have it write to a file.
Wait a finite amount of time.
Then use pt-query-digest
to summarize the results.
Turn off the general log before it fills up disk.
The slowlog (with a small value in long_query_time
) is more useful for finding naughty queries.
Upvotes: 1