The latest release of openark kit introduces oak-hook-general-log, a handy tool which allows for some analysis of executing queries.
Initially I just intended for the tool to be able to dump the general log to standard output, from any machine capable to connect to MySQL. Quick enough, I realized the power it brings.
With this tool, one can dump to standard output all queries using temporary tables; or using a specific index; or doing a full index scan; or just follow up on connections; or… For example, the following execution will only log queries which make for filesort:
[Read more...]oak-hook-general-log --user=root --host=localhost --password=123456
