In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Background:
As a DBA, or engaged in database-related work of small partners, common work is to optimize sql, view the implementation plan! However, sometimes the execution plan given by the optimizer is wrong or not optimal, so we have to trace the process of optimizing the execution plan generation. mysql 5.6 provides tracing the Optimizer function, which is a great tool for optimizing sql.
Track the Optimizer
set optimizer_trace_max_mem_size=300000;
set end_markers_in_json=true;
SET optimizer_trace="enabled=on";
Second, generate sql tracking information
explain select * from test.t1;
SELECT * FROM information_schema.optimizer_trace; --Note: This view has the information we want, as follows:
Third, for example:
For example, sql will be different because of the different values of Limit, and the execution plan will be different:
IV. Conclusion:
There's a lot of content here. I'm just throwing a brick at you. You can go deep into the corner yourself.
==========================================================================
Official website address: dev.mysql.com/doc/internals/en/tracing-example.html
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.