DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(mysql.info.gz) Slow query log

Info Catalog (mysql.info.gz) Binary log (mysql.info.gz) Log Files (mysql.info.gz) Log file maintenance
 
 5.9.5 The Slow Query Log
 ------------------------
 
 When started with the `--log-slow-queries[=FILE_NAME]' option, `mysqld'
 writes a log file containing all SQL statements that took more than
 `long_query_time' seconds to execute. The time to acquire the initial
 table locks are not counted as execution time.
 
 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
 doesn't contain a path, the file is written in the data directory.
 
 A statement is logged 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.
 
 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 pipe the slow query log through the
 `mysqldumpslow' command to get a summary of the queries that appear in
 the log.
 
 Before MySQL 4.1, if you also use `--log-long-format' when logging slow
 queries, then queries that are not using indexes are logged as well.
 queries that are not using indexes also are logged to the slow query
 log.  `--log-long-format' is deprecated as of MySQL version 4.1, when
 `--log-short-format' was introduced. (Long log format is the default
 setting since version 4.1.)  Also note that starting with MySQL 4.1,
 the `--log-queries-not-using-indexes' option is available for the
 purpose of logging queries that do not use indexes to the slow query
 log.   Server options.
 
Info Catalog (mysql.info.gz) Binary log (mysql.info.gz) Log Files (mysql.info.gz) Log file maintenance
automatically generated byinfo2html