3

Im recording slow queries longer than 2 seconds. That is running fine except, the daily backups also get recorded in slow log because 1) mysqldump calls select * from xyz (big table); and 2) when inserting the backup into a new db (yesterday's backup, sundays backup, etc). How to prevent mysqldump from logging slow queries? Is there a temporary way to switch off slow logging when backup is in progress? Please suggest.

Thanks, Vikas

thevikas
  • 1,618
  • 1
  • 14
  • 31

1 Answers1

2

I think that answers it:

To control the slow log at runtime, use the global slow_query_log and slow_query_log_file system variables. Set slow_query_log to 0 (or OFF) to disable the log or to 1 (or ON) to enable it. Set slow_query_log_file to specify the name of the log file. If a log file already is open, it is closed and the new file is opened.

Taken from: http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html

Galz
  • 6,713
  • 4
  • 33
  • 39