MySQL Performance optimizes real-world production (QC)

Source: Internet
Author: User

QC (query cache) to the operation of the database statement cache, the next time in the same operation, will be cached force lookup, in fact, this function is only suitable for frequent and the same operation statement, so the use of the scene is still relatively small. However, if you do not specify--without-query-cache when installing, try to open it by default. However, this can have a significant impact on the performance of the statement execution. When optimizing SQL statements, it is found that:

SELECT * from phpbb_config WHERE config_name = ' num_users '; This statement is relatively slow and random to track and troubleshoot

(1) Do it first

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/88/18/wKioL1fp12XC5hGjAAAmzSiYc5k742.png "title=" 1.png " alt= "Wkiol1fp12xc5hgjaaamzsiyc5k742.png"/>

(2) Show profiles;

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/88/1C/wKiom1fp163Axhv-AADGeVrzF0A305.png "title=" 2.png " alt= "Wkiom1fp163axhv-aadgevrzf0a305.png"/>

(3) You will see the query cache comparison resource 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/88/1C/ Wkiom1fp19ptjfalaadhqro5b8i514.png "title=" 3.png "alt=" Wkiom1fp19ptjfalaadhqro5b8i514.png "/>

(4) First look at the global variables inside the query cache is open decisively close

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/88/18/wKioL1fp2CmR6MO6AABEDT59clo735.png "title=" 4.png " alt= "Wkiol1fp2cmr6mo6aabedt59clo735.png"/>

(5) Close query cache

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/88/18/wKioL1fp2FSx-dv2AAAT38p6uP4065.png "title=" 5.png " alt= "Wkiol1fp2fsx-dv2aaat38p6up4065.png"/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/88/18/wKioL1fp2HLxCAp_AAATc87izbE802.png "title=" 6.png " alt= "Wkiol1fp2hlxcap_aaatc87izbe802.png"/>

(6) Close and look at the execution of the statement

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/88/1C/wKiom1fp2MDjllfYAACLPtlqmsQ534.png "title=" 7.png " alt= "Wkiom1fp2mdjllfyaaclptlqmsq534.png"/>

The last thing you see is a lot more refreshing.


This article is from the "Ideal for Life" blog, please be sure to keep this source http://lampol.blog.51cto.com/11662628/1856872

MySQL Performance optimizes real-world production (QC)

Related Article

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.