MySQL optimization tool

Source: Internet
Author: User
Tags mysql optimization tool

Explain profiling

It is recommended to provide the following information

Show table status like ' audit ';
Show create table audit;
Show index from audit;
Check table audit;

Analyze table audit;

Analyze does not check the table for problems, just re-analyze the distribution of the keys.
Check Table/repaire table is a statement that is checked and repaired

SELECT * FROM [TABLE] Force INDEX (MYINDEX2) WHERE [Column1] = [value1] and [column2] = [value2] ORDER by [id] DESC LIMIT0 , 10;

Insert Ignore into

When we want to use Sql_no_cache to suppress the results cache, we find that the results are not the same as our expectations, and the result of query execution is still the result of the cache. In fact, the real function of Sql_no_cache is to disallow caching of query results, but it does not mean that the cache is not returned to query as a result.

MySQL Quick add millions record statement:

When you insert a record using the Insert SELECT statement, you must follow these guidelines.
When you select data with a SELECT statement, you cannot select rows from the table in which the data is inserted.
Specifies that the inserted table must contain the same number of fields as the number of fields returned in the SELECT statement.
Specifies that the inserted table should contain a field data type that is the same as the field data type returned in the SELECT statement, or the system can be automatically converted.

Copy CodeThe code is as follows:
INSERT into Ler_items (ClassID, title, address, ZipCode)
SELECT ClassID, title, address, ZipCode
From Ler_items
Using the SQL statement above, you can add millions of records to the Ler_items table in a short period of time, and it is helpful to test the database
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.