In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to set up slow query support milliseconds in MySQL, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
MySQL slow query supports millisecond setting
MySQL slow query itself does not support ms level (patch is required), but for versions of MySQL5.21+, the minimum long_query_time value is 0 (before 5.2.1, the minimum is 1s)
The unit is s. If you specify ms, its ms part will be ignored. In fact, this is already supported in millisecond level in disguise. For example, query time greater than 100ms will be recorded in slow log.
We can set up set global long_query_time=0.1
Test:
1. Set global long_query_time=0.1 directly. All queries with query time longer than 0.1s will be recorded in slow log. After setting, log out and log in again.
> set global long_query_time=0.1
Query OK, 0 rows affected (0.00 sec)
Mysql > exit
Bye
-bash-3.2 $
2, execute a query with a query of 0.2s to see if the query is recorded
Mysql > select sleep (0.2); www.2cto.com
+-+
| | sleep (0.2) |
+-+
| | 0 |
+-+
1 row in set (0.21 sec)
# administrator command: Quit
# Time: 120412 15:39:15
# User@Host: root [root] @ localhost []
# Query_time: 0.202244 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
SET timestamp=1334216355
Select sleep (0.2)
It can be seen that this query has been recorded in slow log
On how to set up slow query support milliseconds in MySQL to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.