3

I'm trying to find the slow running queries from slow_log table (as I don't have direct access to server to check slow log file). In sql_text column instead of query it is showing "throttle: index not used' warning(s) suppressed". Could someone help me how to find the slow running query.

enter image description here

  • Are you sure you are using MySQL 5.5 ??? – RolandoMySQLDBA May 1 '15 at 20:20
2

Unfortunately, you are not going to get those queries from mysql.slow_log. Why ?

There are two options evidently being used

According to MySQL Documentation (The Slow Query Log, Paragraph 9)

To include queries that do not use indexes for row lookups in the statements written to the slow query log, enable the log_queries_not_using_indexes system variable. When such queries are logged, the slow query log may grow quickly. It is possible to put a rate limit on these queries by setting the log_throttle_queries_not_using_indexes system variable. By default, this variable is 0, which means there is no limit. Positive values impose a per-minute limit on logging of queries that do not use indexes. The first such query opens a 60-second window within which the server logs queries up to the given limit, then suppresses additional queries. If there are suppressed queries when the window ends, the server logs a summary that indicates how many there were and the aggregate time spent in them. The next 60-second window begins when the server logs the next query that does not use indexes.

What this shows is that your log_throttle_queries_not_using_indexes is set so that SQL text is suppressed. You can verify this with

mysql> SELECT @@global.log_throttle_queries_not_using_indexes;

Since it is a global dynamic variable, you must login as root@localhost and run

mysql> SET GLOBAL log_throttle_queries_not_using_indexes = 0;

This should expose new queries entering mysql.slow_log, but you will never see what those previous slow queries were.

You must run this

mysql> SELECT @@global.log_output;

If you see FILE,TABLE that means there is a text version of the slow query log. You will have to get your SysAdmin to get you the desired slow log info (Starbucks GiftCard might be required for this one. If the slow log file contains the same messages, take your Starbucks GitftCard back.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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