Reputation: 885
How to find the number of select query executed per hour in mysql ?
Is there ant way to find this ?
Please help me out.
Thanks,
Nitesh Kumar
Upvotes: 0
Views: 478
Reputation: 125865
You could enable MySQL's general query logging to a table (note that this has a non-negligible performance impact) and then perform queries on the data:
SELECT DATE(event_time), HOUR(event_time), COUNT(*) AS select_queries
FROM mysql.general_log
WHERE argument LIKE 'select %'
GROUP BY DATE(event_time), HOUR(event_time)
Upvotes: 1