MySQL profiling performance (stored procedure)

Source: Internet
Author: User

Before there is a failure problem, look at the database slow query log, from the log and stored procedure itself directly analysis, can not know the problem point, and then through profiling to analyze, recorded as follows:


0, check the slow query log, found that there is a large number of execution waits 650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/7F/F4/wKioL1cy1Jzzfw_ 4aaa3zxuwyso212.png "title=" 02.png "alt=" Wkiol1cy1jzzfw_4aaa3zxuwyso212.png "/>

-------------use profiling to parse the statement problem point---------------------------------

1, first open profiling: SET profiling=1;

2, manually execute the problematic statement: Call Getrolelist (75760);

3,SHOW profiles; You can see the execution time of each corresponding SQL statement, which needs to be optimized for slow SQL execution;

4, after the completion of execution, close SET profiling=0;


This article from the "Day Up goto" blog, please be sure to keep this source http://ttxsgoto.blog.51cto.com/4943095/1772196

MySQL profiling performance (stored procedure)

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.