| MicroSeconds Slow Query patch [message #190] |
Mon, 25 September 2006 20:40  |
aronrosenberg Messages: 16 Registered: September 2006 |
Junior Member |
|
|
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
set long_query_time=500000;
Also, set GLOBAL doesn't work for long_query_time
|
|
|
|
| Re: MicroSeconds Slow Query patch [message #195 is a reply to message #192 ] |
Tue, 26 September 2006 09:53   |
aronrosenberg Messages: 16 Registered: September 2006 |
Junior Member |
|
|
Is the link correct, since that is the exact same patch that we are using. (just ran a diff on the patch against what we downloaded and no changes)
Would there be any reason that applying the patch against 5.0.22 would cause issues?
|
|
|
|
| Re: MicroSeconds Slow Query patch [message #197 is a reply to message #196 ] |
Tue, 26 September 2006 11:40   |
aronrosenberg Messages: 16 Registered: September 2006 |
Junior Member |
|
|
Vadim,
Is the syntax correct that i referenced above about the my.cnf setting and the while running "SET" command?
|
|
|
|
| Re: MicroSeconds Slow Query patch [message #203 is a reply to message #198 ] |
Wed, 27 September 2006 10:40   |
aronrosenberg Messages: 16 Registered: September 2006 |
Junior Member |
|
|
I get a syntax error with set GLOBAL @@long_query_time=0.7;
No syntax error without the @@, but it doesn't hold the setting past the current session. Just SET @@long_query_time=0.7; works too, but is only session based.
Any ideas?
|
|
|
|
| Re: MicroSeconds Slow Query patch [message #210 is a reply to message #190 ] |
Thu, 28 September 2006 11:54   |
aronrosenberg Messages: 16 Registered: September 2006 |
Junior Member |
|
|
dev-db2 ~ # mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 5.0.22-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set GLOBAL @@long_query_time=0.7;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@@long_query_time=0.7' at line 1
mysql>
|
|
|
|
| Re: MicroSeconds Slow Query patch [message #213 is a reply to message #212 ] |
Fri, 29 September 2006 00:10  |
aronrosenberg Messages: 16 Registered: September 2006 |
Junior Member |
|
|
|
Thanks, that works properly for other sessions.
|
|
|