# Turn on logging set global log_output=FILE; set global general_log=1; # Turn off logging set global general_log=0;
The log file was writing it to mysql/data/{hostname}.log on my machine.
I recently used this to discover why a Rails app was taking 15 seconds to load a page. I know this is also shown in the Rails log, but I wanted to show the impact of the SQL statements alone. It is much easier to look at the MySQL log which isolates the SQL calls.
This application was performing over 600 database operations. I’m amazed at how many developers don’t take the time to truly understand the impact their code has on a database. Sad to say, this kind of crappy code is all over that application. I hate inheriting crap.
Post a Comment