Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've told MySQL to log queries that take longer than a second (1 in the config)... however I'm seeing queries like this that take much less than a second....

# Time: 101108  6:39:32
# User@Host: source_member[source_member] @ localhost []
# Query_time: 0.007271  Lock_time: 0.000062 Rows_sent: 1  Rows_examined: 2635
SET timestamp=1289216372;
SELECT
                                                id,
                                                name,
                                                email,
                                                auth_key
                                        FROM member
                                        INNER JOIN source_member.group_assoc ON (
                                                source_member.group_assoc.group_id = 121 AND
                                                source_member.group_assoc.member_id = member.id
                                        );

My settings are...

log_slow_queries        = /var/log/mysql/mysql-slow.log
long_query_time = 1
log-queries-not-using-indexes

I should ask... this means that it's only logging queries that do not have any indexes at all?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

What is long_query_time set to? log-long-format or log-queries-not-using-indexes active?

The most likely explanation either an incorrect setting of logging.

--log-queries-not-using-indexes and log-long-format both cause queries not using Indexes to be logged. Sometimes not using an index is faster, and this can cause a lot of log spam.

Also note that you might lock on IO somewhere. long_query_time is checked against WALL time not CPU time.

share|improve this answer
    
I've updated my post with my settings.... I can't find any examples of log-long-format on google –  Webnet Nov 8 '10 at 18:16
    
And here is your explanation: dev.mysql.com/doc/refman/5.0/en/… ;) –  pehrs Nov 8 '10 at 19:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.