Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The slow query log contains queries that run longer than
long_query_time seconds. The default
value of this variable is 10, but you can decrease it. In fact, by
setting the value to zero, you can log all queries. Since version 5.1,
you can turn logging to the slow log on and off dynamically as needed,
just as for the general query log. You can also redirect output to a
table, so it can be queried like any other.
For performance tuning, find the slowest queries, check them one
by one in isolation, and then change the query statement or make other
necessary changes, such as to indexes. You can start from the default long_query_time, then decrease it bit by bit
to zero to find more and more queries. This method reveals the slowest
queries first.