0
mysql> select @@long_query_time;
+-------------------+
| @@long_query_time |
+-------------------+
|          2.000000 |
+-------------------+
1 row in set (0.00 sec)

mysql> select @@log_queries_not_using_indexes
    -> ;
+---------------------------------+
| @@log_queries_not_using_indexes |
+---------------------------------+
|                               0 |
+---------------------------------+
1 row in set (0.00 sec)

but the slow query log contains:

# Query_time: 1.000111  Lock_time: 0.000000 Rows_sent: 1  Rows_examined: 0 SET timestamp=1559116596; select sleep(1);

Is there any other variable that affects this?

1 Answer 1

0

If you add to my.cnf ( or my.ini )

min_examined_row_limit=1

the line should be omitted in the slow query log - in this case, no rows were examined.

3
  • tks for reply! min_examined_row_limit:Queries that examine fewer than this number of rows are not logged to the slow query log. when i set this variable min_examined_row_limit=0 means log all query? but regardless the variable log_query_time?
    – ping chem
    Commented May 30, 2019 at 5:50
  • I have found there are some instances where the slow query log is 'littered' with this type information and long_query_time appears to be ignored when the decision is made to 'log' this type of query. With min_examined_row_limt=1 it most likely will NOT be listed in the slow query log. Commented May 30, 2019 at 13:07
  • yes,it works but still puzzle ,thk you !
    – ping chem
    Commented May 31, 2019 at 3:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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