DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info) slow-query-log

Info Catalog (mysql.info) binary-log (mysql.info) log-files (mysql.info) log-file-maintenance
 
 5.12.4 The Slow Query Log
 -------------------------
 
 The slow query log consists of all SQL statements that took more than
 `long_query_time' seconds to execute. The time to acquire the initial
 table locks is not counted as execution time. The minimum and default
 values of `long_query_time' are 1 and 10, respectively.
 
 `mysqld' writes a statement to the slow query log after it has been
 executed and after all locks have been released. Log order may be
 different from execution order.
 
 To enable the slow query log, start `mysqld' with the
 -log-slow-queries[=FILE_NAME] option.
 
 If no FILE_NAME value is given, the default is the name of the host
 machine with a suffix of `-slow.log'. If a filename is given, but not as
 an absolute pathname, the server writes the file in the data directory.
 
 The slow query log can be used to find queries that take a long time to
 execute and are therefore candidates for optimization.  However,
 examining a long slow query log can become a difficult task. To make
 this easier, you can process the slow query log using the
 `mysqldumpslow' command to summarize the queries that appear in the
 log. Use `mysqldumpslow --help' to see the options that this command
 supports.
 
 In MySQL 5.0, queries that do not use indexes are logged in the slow
 query log if the -log-queries-not-using-indexes option is specified.
 See  server-options.
 
 In MySQL 5.0, the -log-slow-admin-statements server option enables you
 to request logging of slow administrative statements such as `OPTIMIZE
 TABLE', `ANALYZE TABLE', and `ALTER TABLE' to the slow query log.
 
 Queries handled by the query cache are not added to the slow query log,
 nor are queries that would not benefit from the presence of an index
 because the table has zero rows or one row.
 
Info Catalog (mysql.info) binary-log (mysql.info) log-files (mysql.info) log-file-maintenance
automatically generated byinfo2html