Nitesh Kumar
Nitesh Kumar

Reputation: 885

Find no of select query executed per hour in mysql?

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

Answers (1)

eggyal
eggyal

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

Related Questions