Not the answer you need?
Register and ask your own question!
Many Forum changes were implemented on Tue 22 Sep. Read about new Ranks, Scoring, and Reactions.
Email [email protected] for any comments or concerns.

Slow query log logs query < long_query_time

HubertusKrogmannHubertusKrogmann ContributorInactive User Role Contributor
Hello

after a search in the forums and finding several people having the same problem, I can't find a valid answer.

Server version: 5.5.30-30.2-log Percona Server (GPL), Release rel30.2, Revision 508

| long_query_time | 5000.000000 | milliseconds I think

I still get:
SET timestamp=1368927144;
select * from lbtest;
# Time: 130519 3:32:27
# [email protected]: jdbcReplication[jdbcReplication] @ [10.64.101.241]
# Thread_id: 37942 Schema: view_hc Last_errno: 0 Killed: 0
# Query_time: 0.000213 Lock_time: 0.000094 Rows_sent: 1 Rows_examined: 13 Rows_affected: 0 Rows_read: 13
# Bytes_sent: 795

and the logfiles is going to eat up the disk.
I would say, every statement is logged

How do I configure the percona Server to log only query which take longer "x" seconds?

I would assume
| slow_query_log | ON |
| slow_query_log_file | /path/to/logfile |
| long_query_time | 5000.000000 |

but that does not the trick.

Regards

Comments

  • miguelangelnietomiguelangelnieto Member Inactive User Role Beginner
    Check that the variable log-queries-not-using-indexes is not enabled. With that variable enabled MySQL will log every issue that doesn't use indexes, even if the query is faster than long_query_time.
  • HubertusKrogmannHubertusKrogmann Contributor Inactive User Role Contributor
    Check that the variable log-queries-not-using-indexes is not enabled. With that variable enabled MySQL will log every issue that doesn't use indexes, even if the query is faster than long_query_time.


    Yes, I think that solved the problem, but it would be nice to have both.
    Thanks.
  • mcubedpemcubedpe Entrant Current User Role Beginner
    Thank you!

    I didn't noticed that the my.cnf - generated by the Percona tools - had - log_queries_not_using_indexes=1... changed to log_queries_not_using_indexes=0 - and life it looking more normal for my slowlogs again.

    Would be nice if we could log log_queries_not_using_indexes - to a log called - log_queries_not_using_indexes.log :-) ( and not to the slow log ).

    -Michael
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.