In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you the content of the example analysis that the MySQL slow query log is not printed. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Test environment modifies long_query_time=0.2
The slow query log does not take effect when executing the following query
Mysql > select sleep (5)
+-+
| | sleep (5) | |
+-+
| | 0 |
+-+
1 row in set (5.00 sec)
⑴ then checks the parameters
Mysql > show variables like'% query%'
+-+ +
| | Variable_name | Value |
+-+ +
| | binlog_rows_query_log_events | OFF |
| | ft_query_expansion_limit | 20 |
| | have_query_cache | YES |
| | long_query_time | 1.000000 | |
| | query_alloc_block_size | 8192 | |
| | query_cache_limit | 0 | |
| | query_cache_min_res_unit | 4096 | |
| | query_cache_size | 0 | |
| | query_cache_type | OFF |
| | query_cache_wlock_invalidate | OFF |
| | query_prealloc_size | 8192 | |
| | slow_query_log | ON |
| | slow_query_log_file | / mlogs/slow1.log |
+-+ +
Found that the configuration is normal.
⑵ then checks the following two parameters
Min_examined_row_limit 、 long-queries-not-using-indexes
Mysql > show variables like 'min_examined_ro%'
+-+ +
| | Variable_name | Value |
+-+ +
| | min_examined_row_limit | 10 | |
+-+ +
1 row in set (0.00 sec)
Mysql > show variables like 'log_queries_not_using_indexes'
+-+ +
| | Variable_name | Value |
+-+ +
| | log_queries_not_using_indexes | OFF |
+-+ +
Then set min_examined_row_limit to 0, and the slow query will record
Two parameters:
Log_queries_not_using_indexes, a query that indicates that the record does not use the index when on, even if it does not exceed the long_query_time
Min_examined_row_limit, which means to record as many queries as possible (when min_examined_row_limit=on)
Reason: select sleep (5) statement query has no record (that is,
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.