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?

link|improve this question

feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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