0708 about understanding MySQL SQL execution Order

Source: Internet
Author: User

Turn from http://www.jellythink.com/archives/924, the blog is a clear comparison

I understand that the above is the SQL execution order overall scenario. When you join the index, in fact his execution plan is a slight change, for example, just beginning no longer Mr. Cartesian product, but for SQL rewrite and evaluation, see which index scan to use less, lower cost. We then use the mechanism of the MySQL nesting loop to find the execution order of the tables. Finally, after determining the reading method, the best left table is found by index, then nested loops find the right table and then follow the SQL execution order.

This also explains that the index is first added in the Where field and then the group by field is processed to the last order by field, which is determined by the SQL execution order.

Classic Summary 0707: about whether the index is first where or first group

0708 about understanding MySQL SQL execution Order

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.