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)