Patch: use_global_long_query_time

This patch adds a configurable variable that causes slow query logging to use the global value for long_query_time, instead of the local value each thread sees.

Without this patch, a long-lived connection to MySQL will not normally see changes to the global long_query_time variable, so in many cases it's not possible to configure the logging time without restarting the application or the server. With the patch, it is quick and easy to change the logging behavior across all threads with no interruption to service.

This patch is included as part of slow_extended.

Version-Specific Information

The patch is first available in the Percona 5.0.77 build 13 and Percona 5.0.75 build 13.

Variables Provided

The patch provides the following variables:

use_global_long_query_time

TypeSystem and command-line variable
ScopeGlobal
DynamicYes
Default0

Whether threads should use the global value of long_query_time. The default value of 0 provides the same behavior as an unpatched MySQL server: a connection inherits its value of long_query_time from the global value when it is created, and does not refer to it afterwards. When the variable is set to 1, threads use the global value, and the local value is updated when the global value is changed.

Related Reading

Patch Information

Author/Origin Percona
Bugs fixed
Dependencies slow_extended
Please note that this is NOT a place to ask questions or report bugs. This comment system is only intended for users to share tips and documentation additions concerning particular document.
Please report bugs to https://bugs.launchpad.net/percona-project/+filebug and ask general questions in maillist Percona-discussions

Discussion

Enter your comment (wiki syntax is allowed):
DRAGH
 
patches/use_global_long_query_time.txt · Last modified: 2010/07/21 08:09 by oleg.tsarev
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki