0

I need to do some analysis of table usage within my MySQL system. Can anyone point me in the right direction on a method for identifying which table has been queried most often in a given time-period i.e. if there are 30 tables, I want to know which table is accessed most.

gurudeb
  • 1,856
  • 22
  • 29
  • 1
    Please specify... Maybe you mean '... table that is read the _most_...' Also it is quite difficult to know what you mean by 'maximum hits on a table' ? – mjv Dec 27 '12 at 14:48
  • Check out http://stackoverflow.com/q/6137935/384155 – Osiris Dec 27 '12 at 14:50

2 Answers2

1

You should use pt-table-usage to analyze the general query log. It will out put nice information about table usage (as long as you're not using stored procedures or stored functions cause those will be missed).

Andreas Wederbrand
  • 38,065
  • 11
  • 68
  • 78
0

Enable query logging temporarily while your application is running and review the log. It can have some performance impact, so you don't want to leave it permanently enabled.

Ask Bjørn Hansen
  • 6,784
  • 2
  • 26
  • 40