In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
What is filesort sorting in MySQL? for this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Filesort, as a topic that cannot be avoided by DBA, is often discussed by friends. For example, common questions are as follows:
When sorting, will the data used for sorting compress empty character storage like Innodb, such as varchar (30), will I only store 1 character, will it be compressed, or will it be calculated according to 30 characters?
What exactly does max_length_for_sort_data/max_sort_length mean?
What is the fundamental difference between original filesort algorithm (back table sort) and modified filesort algorithm (no return table sort)?
Why is the Rows_examined in slow queries larger when sorting is used, and what exactly is the way of calculation?
In MySQL, there are usually the following algorithms to complete the sorting:
Memory sort (priority queue order by limit returns a small number of rows commonly used to improve sorting efficiency, but note that order by limit n sorting m if n is too large may involve sorting algorithm switching)
Memory sort (quick sort)
External sort (merge sort)
However, due to the limited capacity, this paper does not explain these algorithms, and this paper does not consider the branch logic of the priority queue algorithm, and only carries on the process analysis on the basis of quick sorting and merge sorting.
If the word filesort appears in the execution plan, it usually means that sorting is used, but the following problems are not seen in the execution plan:
Whether temporary files are used.
Whether priority queues are used.
Is original filesort algorithm (sort back to the table) or modified filesort algorithm (sort back to the table).
This is the answer to the question about what is filesort ranking in MySQL. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.