Copyright (C) 2000-2012 |
GNU Info (mysql.info)Slow query logThe Slow Query Log ------------------ When started with the `--log-slow-queries[=file_name]' option, `mysqld' writes a log file containing all SQL commands that took more than `long_query_time' to execute. The time to get the initial table locks are not counted as execution time. The slow query log is logged after the query is executed and after all locks has been released. This may be different than the order in which the statements are executed. If no file name is given, it defaults to the name of the host machine suffixed with `-slow.log'. If a filename is given, but doesn't contain a path, the file is written in the data directory. The slow query log can be used to find queries that take a long time to execute and are thus candidates for optimization. With a large log, that can become a difficult task. You can pipe the slow query log through the `mysqldumpslow' command to get a summary of the queries which appear in the log. You are using `--log-long-format' then also queries that are not using indexes are printed. Note: Command-line options. automatically generated by info2www version 1.2.2.9 |