'How to myke the MySQL Slow Query Log respect the long_query_time?
My Slow Query Log is full of queries, that should not be written there, e.g.:
# Time: 2022-03-11T12:23:29.258308Z
# User@Host: ...
# Schema: ...
# Query_time: 0.022791 Lock_time: 0.000201 Rows_sent: 1000 Rows_examined: 1000 Rows_affected: 0 Bytes_sent: 115518
use ...;
SET timestamp=1647001409;
SELECT * FROM `my_table` LIMIT 0,1000;
The query time is 0.022791
seconds. And the long_query_time
is 5.000000
:
mysql> SHOW VARIABLES WHERE `variable_name` = "long_query_time";
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| long_query_time | 5.000000 |
+-----------------+----------+
What's going wrong here? How to avoid such a "spam" in the Slow Query Log?
mysql> SELECT VERSION();
+---------------+
| VERSION() |
+---------------+
| 5.7.36-39-log |
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|