MySQL SQL statement performance tuning simple example When doing server development, sometimes there are certain requirements for concurrency, and sometimes it is a certain SQL statement, such as a stored procedure, that affects the speed. Now suppose that during the execution of the server code, a certain SQL statement executes slowly. How can we optimize it? Suppose now the server code executes the following SQL stored procedure very slowly: call sp_wplogin_register(1, 1, 1, '830000', '222222'); You can debug as follows: 1. Open mysql profiling: 2. Then execute the SQL that needs to be tuned. Here we execute two SQL statements, one commit statement and the other one is to call the above stored procedure statement: 3. Use profiling to display the execution time of each SQL statement. The stored procedure consists of a series of SQL statements, which are also broken down and displayed here: It can be seen that the execution speed of the sql marked in red is far from the same level as other sql statements. We optimize this row, for example, by creating an index for the field f_phone. Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: Creating a file system for ARM development board under Linux
>>: Steps to transplant the new kernel to the Linux system
mysql storage engine: The MySQL server adopts a m...
Copy table structure and its data The following s...
I recently watched Apple's press conference a...
Preface I don't know how long this friend has...
Use CSS3 to achieve cool radar scanning pictures:...
Platform deployment 1. Install JDK step1. Downloa...
Table of contents Install and introduce axios dep...
Recently, I came across a webpage that had images ...
MySql Null field judgment and IFNULL failure proc...
In most application scenarios, we need to back up...
Website, (100-1)% of the content is navigation 1....
Recently, the company has begun to evaluate all s...
Table of contents 1. Introduce according to the o...
Jupyter notebook is configured under the docker c...
This article shares the specific code of vue echa...