In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what are the common optimization types of mysql". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the common optimization types of mysql".
1. Redefine the order of associated tables.
The association in the data table does not always follow the order specified in the query, and determining the association order is an important function of the optimizer.
2. Convert the outer connection into the inner connection.
Not all outerjoin statements must be executed as external connections. Many factors, such as where conditions and library table structures, may equate external joins with internal joins. MySQL can recognize this and rewrite the query to adjust the association order.
3. Use the equivalent transformation rule.
MySQL can use some equivalent transformations to simplify and standardize expressions. It can merge and reduce some comparisons, and it can also remove some permanent and untenable judgments. For example, (5=5anda > 5) will be rewritten to a > 5. Similarly, if there is (a5andb=canda=5).
4. Optimize count (), min () and max ()
Whether the index and column are empty usually helps MySQL optimize this expression. For example, to find the minimum value of a column, you only need to query the leftmost record of the B-tree index, and MySQL can directly get the first row of records of the index.
Estimate and convert to a constant expression.
5. Overwrite index scan.
When the columns in the index contain the columns needed in all the queries, MySQL can use the index to return the desired data without querying the corresponding data rows.
6. Optimize the subquery.
In some cases, MySQL can convert subqueries into a more efficient form, thereby reducing access to data by multiple queries.
Thank you for your reading, these are the contents of "what are the common optimization types of mysql". After the study of this article, I believe you have a deeper understanding of what the common optimization types of mysql are, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.