All Products
Search
Document Center

ApsaraDB RDS:Table Maintenance in DMS

Last Updated:Nov 22, 2023

This topic describes how to maintain tables in DMS.

Optimize a table

Optimize the table using the command optimize table <table name>.Optimize a table

Check tables

The check table uses the command check table <table name>, check the table for errors. There are several options when checking the table:

  • Fast: when checking for errors in the table, rows will not be scanned to check for incorrect links.

  • Quick: only check tables that are not closed correctly when checking tables.

  • Changed: only tables that have changed since the last check or that have not been properly closed will be checked when checking the table.

  • General: when checking the table, the system scans the rows to confirm that the deleted link is valid. The system also calculates the key checksum of the row and uses the calculated key checksum for verification.

  • Extension: when the table is checked, a comprehensive search is performed for all keywords in each row, which can ensure that the table is 100% consistent, but it takes a long time.

Note

The execution speed is fast> Fast> changed> General> extension.

Checksum tables

The command used to repair the table is repair table <table name>, there are multiple options when repairing the table.

The options are described as follows:

  • General: no parameters are required. Namely repair table <table name>, indicating the simple repair data file and index file.

  • quick: add the quick parameter, that is, repair table <table name> quick, indicating that the fastest restoration is required, that is, only the index file is fixed but not the data files.

  • Extension: add the extended parameter, that is, repair table <table name> extend, modify the data file and index file. If you try to recover each row from the data file, reindex the row by row.

Note

The execution speed is General> Fast> expansion.

Analyze tables

The analysis table uses the following command: analyze table <table name>.