We have been playing with the MicroSecond patch that was on the blog a week or so ago.
The basic patch seems to work some times, however there appears to be some strange behavior or missing documentation on how to set the intial value or change it while in operation.
Reading the code, you seem to take the .cnf option as microseconds. So if I want the slow query time to be 500ms, I would set
long_query_time = 500000
log-slow-queries = /var/log/mysql-slow.log
in the my.cnf file
When I then startup mysql, I use show variables and see the value has been set to 0.500000 (floating point 1/2 sec, so would seem correct) and slow query logging is on.
If I then run a query using the command line client that takes .72 seconds, nothing shows up in the logs.
If I set the long_query_time = 0 in the cnf file, then everything shows up with proper microsecond timing. However any value other than 0 doesn’t seem to work properly.
for changing it at run time is the proper syntax:
set long_query_time=0.5; or
Also, set GLOBAL doesn’t work for long_query_time