Inaccurate MySQL execution plan-Overview, mysql execution plan

Source: Internet
Author: User
Tags mysql manual

Inaccurate MySQL execution plan-Overview, mysql execution plan


The execution plan for the Mao MySQL optimizer is often inaccurate, but not optimal (cpu + io )???

Too many factors ::


The information of information_schema is regularly refreshed. In many cases, it is not the most authentic, or even the difference is very large (when it is not a mountain peak, make good use of analyze table and so on );


Now, an enterprise has no money to spend and buys a lot of Solid State disks. It happens that non-intelligent MySQL cannot keep up with the pace of hardware optimization, more than one part of the selection principle may be inaccurate (I believe that other databases are also a pain point );


Environmental factors/

Configuration Factors

And so on...



Mysql execution plan

After mysql5.1, there will be a command called event. When the specified time is reached, your prepared SQL statement will be executed. It should be suitable for you.
The following is an event sentence I wrote a few days ago. I will give you an example. You can modify it as needed.
Delimiter |

Create event 'event1'
On schedule
At '2017-11-27 18:05:00'
Do
Begin

UPDATE limit_master
SET
Limit_value = 2,
Upd_date = now ()
WHERE
Limit_code = 0;

End |
Delimiter;
These are the most basic, and I only specified the time. It is also an execution. If it is executed every day, change the time to every + the time you want (for example, every 1 day/every 1 hour ).
For more information, see the mysql manual.

What is the SQL Execution Plan of MYSQL? Use explain? What is the specific meaning of the MYSQL execution plan?

Using explain, MySQL explains how it processes SELECT and provides the order of how tables are joined and joined. You can see whether the index is correctly used. Based on this, adjust your SQL statement or index creation.

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.