Maintaining a Table
As workloads increase, frequent insert, update, and delete operations can cause table fragmentation, degrading database server performance. To address this, periodic maintenance is required.
Functions
- Check
Allows you to check whether there are errors in database tables using the CHECK TABLE statement. You can check a table with any of the following methods: Check, Quick, Fast, Changed, and Extended.
- Check: scans rows to verify that deleted links are valid. Alternatively, calculate a key checksum for the rows and verifies the validity using the obtained checksum.
- Fast: neither scans rows nor checks for incorrect links.
- Quick: checks only tables that have not been closed properly.
- Changed: checks only the tables that have been changed since the last check and the tables that have not been closed properly.
- Extended: searches for keywords in each row.
The CHECK TABLE statement adds a read-only lock to the table.
- Repair
Allows you to use the REPAIR TABLE statement to repair possibly corrupted or incorrect tables. You can repair tables using any of the following three methods:
- REPAIR TABLE Table_name: roughly repairs data and index files. No parameter is added.
- REPAIR TABLE Table_name QUICK: repairs index files only. This method is faster than others.
- REPAIR TABLE Table_name EXTENDED: re-creates indexes row by row to repair data and index files. This method is slower than others.
Check
- Log in to the DAS console.
- Click
in the upper left corner and select a region and project. - In the navigation pane on the left, choose Development Tool.
You can also click Go to Development Tool on the overview page.
- Locate the DB instance that you want to log in to and click Log In in the Operation column.
- On the top menu bar, choose Database Management. On the displayed Objects tab, choose Tables on the left.
- In the right pane, locate the table you want to maintain and choose More > Maintain > Check in the Operation column.
- Select a check method as required. You can check a table with any of the following methods: Check, Quick, Fast, Changed, and Extended.Figure 1 Selecting a check method
- In the displayed dialog box, click Yes.
Repair
- Log in to the DAS console.
- Click
in the upper left corner and select a region and project. - In the navigation pane on the left, choose Development Tool.
You can also click Go to Development Tool on the overview page.
- Locate the DB instance that you want to log in to and click Log In in the Operation column.
- On the top menu bar, choose Database Management.
- On the displayed Objects tab, choose Tables on the left.
- Locate the table you want to repair and choose More > Maintain > Repair in the Operation column. Figure 2 Repair
- Select a repair method as required. You select Check, Quick, or Extended.Figure 3 Selecting a repair method
- In the displayed dialog box, click Yes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot