Use of profiler debugging tools in MySQL

Source: Internet
Author: User
MySQL has provided profiler tools since 5.0.37, which is often useful for performance debugging. The primary purpose of profiler is to display the consumption of resources in the entire process of executing an SQL statement. The parser can better show the performance bottleneck of poor SQL statements. The following describes how to use profiler. Step 1: Enable profilermysql> set profiling = 1; query OK, 0 rows affected (0.04 Sec) ii. display the profile information of multiple queries saved in the current system mysql> show profiles; empty set (0.00 Sec) III. Execute the query statement mysql> select singer. sinaid, name from 't_wpp_pending_singer 'singer left join 'T_ wpp_pending_status 'status on Singer. sinaid = status. sinaid
Where status = 1 limit 50;
4. Execute the command and then display the profile information mysql> show profiles;

5. display the profile of the first query. mysql> show profile for query 1;

6. display the profile summary and CPU usage of the first query. mysql> show profile CPU, block Io for query 1;
7. Disable profilermysql> set profiling = 0; query OK, 0 rows affected (0.00 Sec)

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.