Maintaining a Table
While working with the MySQL database, you do a lot of changes such as insert, update and delete data in the table that may cause table fragmentation. As a result, the performance of database server is deteriorated. You need to maintain tables periodically to improve the database performance.
You have logged in to the DAS console and entered the Standard Edition page.
- Optimize Table
The OPTIMIZE TABLE statement is used to optimize tables and avoid table fragmentation.
During the optimization, read-only locks are added to tables. Therefore, you are advised to perform this operation during off-peak hours.
- Analyze Table
The ANALYZE TABLE statement is used to analyze tables. During the analysis, read-only locks are added to tables. During the analysis, you cannot update in or insert data into the tables.
The following operations show how to optimize a database table. The procedure for analyzing tables is similar.
- On the top menu bar, choose Database Management.
- On the displayed Objects tab, choose Tables on the left, locate the target table, and choose More > Maintain > Optimize in the Operation column.
- In the displayed dialog box, click Yes.