Let's take a look at how to optimize this mysql statement.

Source: Internet
Author: User
Help me to see how to optimize the explainselectSQL_CALC_FOUND_ROWSd.id, d. goodlevel, d. ismainfield, d. lirun, d. introduce, d. shen, d. city, d. mainfield, d. charges, d. type, m. indentity, m. nickasname, m. us helps to see how to optimize this mysql statement
Explain select SQL _CALC_FOUND_ROWS d. id, d. goodlevel, d. ismainfield, d. lirun, d. introduce, d. shen, d. city, d. mainfield, d. charges, d. type, m. indentity, m. nick as name, m. username, d. cxt_num, v. vnum
From tab1 as d left join tab2 as m on d. id = m. uid left join tab3 as v on d. id = v. uid order by d. goodlevel desc, d. cxt_num desc, v. vnum desc limit 10, 10

------ Solution --------------------
I don't know your business. it's hard to change it. The index mentioned above is actually the same if you add no index to this statement.


From tab1 as d left join

======================================
D is the left Table. it must be a full table scan. Consider whether you need tab1 full table data.

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.