Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the operation of the query optimizer in mysql

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "what is the operation of the query optimizer in mysql". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "what is the operation of the query optimizer in mysql" can help you solve your doubts.

1. MySQL uses a cost-based optimizer, which attempts to predict the cost of a query using a certain execution plan and selects the optimizer with the lowest cost.

2. The query optimizer needs to obtain the corresponding statistics from the storage engine to generate the execution plan of the query.

The storage engine provides the optimizer with corresponding statistical information, including: how many pages are there in a table or index, what is the cardinality of each index in each table, the length of data rows and indexes, the distribution of indexes, and so on. The optimizer selects the implementation plan based on this information.

Example

Mysql > EXPLAIN SELECT * FROM tbl_name WHERE 0gamma Gmail * 1. Row * * id: 1select_type: SIMPLEtable: NULLtype: NULLpossible_keys: NULLkey: NULLkey_len: NULLref: NULLrows: NULLExtra: Impossible WHERE read here, this article "what is the operation of query optimizer in mysql" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the articles, you are welcome to follow the industry information channel.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report