Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

sql_log_slow and executable comment version fun.

From: Eric Bergen <eric(at)provenscaling.com>
Date: Thu Jul 19 2007 - 00:48:33 EDT


The slow query log is a great tool for finding long running queries. One thing it doesn't do is allow you to not log known slow queries. Slow queries from things like importing large sql files. With long_query_time set low enough bulk insert queries from dump files are also written out to the slow query log. The entire query is written to the log. On a large dump file the log can quickly grow to gigs in size.

This patch serves two purposes. First it adds a variable to mysql that works exactly like sql_log_bIn in that it allows clients to prevent queries from being logged at the session level. Second it updates mysqldump to add this variable to it's dump output.

A possible side effect of this new variable output is that it's tagged with a version number. In the old days this would be fine since newer versions of mysql will know about the variable and act accordingly. However, with mysql enterprise it's possible that newer versions of enterprise will have a higher version number than what's in output of mysql yet not support the new variable. Importing a dump file created on a version of mysql with this patch then trying to import it on a newer version without the patch will error. What are the lists thoughts on how to handle this?

The patch is at:
http://ebergen.net/patches/sql_log_slow.patch

It was written for 5.0.41 but applies against 5.0.45 as well. I can rebuild the patch for the newer version is necessary.
--

high performance mysql consulting.
http://provenscaling.com

--

MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?unsub=lists@pantek.com Received on Thu Jul 19 00:48:48 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:06:18 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library