MySQL Optimization 1

Source: Internet
Author: User

The system will slowly become slow in the application for a long time, whether it is human or machine in order to better work and study need to study properly. Database is the same as the use of long-time, nature will produce space debris, we need all the data blocks in the database for maintenance and collation. The following example illustrates and explains this problem.

The MySQL database provides the appropriate functions for the collation of the data. Optimize table. Data in the database is collated based on the data obtained.

1. To create a test database table

(1) CREATE TABLE TB1 table

(2) The following information is present in the database folder after the table is created

2. Inserting test data

(1) Adding test data

(2) Simulation to delete redundant data

(2) Careful may find that the storage data data space does not carry on the space collection, below through Optimize table table_name; The data space is effectively organized.

Do the above, after the inquiry information to know

Table does not support optimize, doing recreate + analyze instead.

It is because, the table, and the using is InnoDB.

You can optimize the InnoDB tables by using this.

As long as the error caused by the InnoDB operation is used. There is also a command according to the MySQL feature to idui the space as follows

MySQL Optimization 1

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.