This topic describes how to recycle space fragments in the databases for which the lock-free schema change feature is enabled in Data Management (DMS).

Prerequisites

Background information

Frequent execution of UPDATE and DELETE statements in a database results in space fragments. These space fragments may be wasted if they are not recycled. You can recycle space fragments to improve database performance.

Usage notes

  • If you do not need to change table schemas in the short run, you can submit a data change ticket to recycle space fragments.
  • If you need to change table schemas in the short run, you can submit a data change ticket to change schemas. During schema changes, space fragments are automatically recycled.
Note Data change and space fragment recycling can be implemented at the same time only for the databases for which the lock-free schema change feature is enabled.

Procedure

  1. Go to the DMS console V5.0.
  2. In the top navigation bar, click Database Development. In the left-side navigation pane, choose Data Change > Normal Data Modify.
  3. On the Data Change Ticket Application page, set the parameters as required and enter the SQL statements that are used to modify the comments on tables or fields in the SQL Statements for Change field. After the data change, the space is defragmented. For more information, see Change regular data.

    You can use one of the following SQL statements in the ticket:

    • ALTER TABLE table_name COMMENT 'Modified table comments';
    • ALTER TABLE table_name ENGINE=InnoDB;
    • OPTIMIZE TABLE table_name;
    • ALTER TABLE table_name MODIFY COLUMN field_name INT COMMENT 'Modified field comments';
Note Database administrators (DBAs) and DMS administrators can also change table schemas by running SQL tasks. For more information, see Manage tasks.