MySQL--->profile use

Source: Internet
Author: User
MySQL Analysis-profile Detailed introduction
  • Profiling is open from the mysql5.0.3 version.
    After the profile is started, all queries including the wrong statements are logged.
    This tool can be used to query the SQL execution state, how much time is spent on System lock and table lock, etc.
    It is important to locate the I/O consumption and CPU consumption of a statement. (The largest two-part resource consumed by SQL statement execution is IO and CPU)
  • After mysql5.7, profile information will gradually be discarded, MySQL recommended to use the performance schema
Use
  • View profile status: Show variables like "%pro%";
  • Open/close Profile:set profiling = 1/0
  • Start analysis: Show profiles;

  • We can also query for a single, finer execution: Show profile for query 4; The number behind is query_id.
  • Clear the SQL cache: Reset query cache, so that our analysis results more accurate, to obtain an objective data results.

MySQL--->profile use

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.