In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to locate and optimize slow query sql". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to locate and optimize slow query sql.
Locate slow query sqlmysql > show variables like "% query%" based on slow log +-+ | Variable_name | Value | + -- +-- + | binlog_rows_query_log_events | OFF | | ft_query_expansion_limit | | 20 | | have_query_cache | YES | | long_query_time | 10.000000 | query time | query_alloc_block_size | 8192 | | | query_cache_limit | 1048576 | | query_cache_min_res_unit | 4096 | | query_cache_size | 1048576 | | query | _ cache_type | OFF | | query_cache_wlock_invalidate | OFF | | query_prealloc_size | 8192 | | slow_query_log | OFF |. Whether slow logs are enabled | slow_query_log_file | / usr/local/mysql/data/tandeMacBook-Pro-slow.log | slow log log location + -+ mysql > set global show_query_log = on Open slow log (preferably written in configuration file) mysql > set global long_query_time = 1; set slow log query time mysql > show status like "% slow_queries%" +-+-+ | Variable_name | Value | +-+-+ | Slow_queries | 0 | number of slow queries +-+-+ use explain and other tools to analyze sqlmysql > explain select * from t_employee where name = "Wang Yan" +- -+-+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +- -+ | 1 | SIMPLE | t_employee | NULL | ref | idx_employee_name | idx_employee_name | 50 | const | 1 | 100.00 | NULL | + -+- -+-+ so far I believe you have a deeper understanding of "how to locate and optimize slow query sql", so you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.