tags:

views:

51

answers:

1

My Mysql slow query log shows many entries like this:

# Time: 100104 16:32:14
# User@Host: root[root] @ localhost []
# Query_time: 2.929673  Lock_time: 0.000000 Rows_sent: 0  Rows_examined: 0
use mydatabase_production;
SET timestamp=1262651534;
COMMIT;

** Note the absence of any actual query! **

This began within the past day. It's being used by a Rails app. Does anybody know what this is, and how to fix it? Thanks!

+1  A: 

"SET" is a query. The question is why the COMMIT? its absolutely unnecessary.

On to the slow queries. If you have a slow query it can have a cascading effect. In other words the query above is not necessarily slow but because its waiting for another query to execute which is slow it gets caught as well.

This unfortunate situation can cause you to look in the wrong place for the solution. if you have queries that are taking longer then the above start with the longest one, fix that and work your way down.

After fixing the worst one many if not all of the rest will disappear.

DC

DeveloperChris