How Do I Use ANALYZE & OPTIMIZE?
This section describes FAQs about using ANALYZE & OPTIMIZE.
Why Does the Space Usage Not Decrease After Data Is Deleted?
TaurusDB optimizes space management for deleted data. By default, the space occupied by deleted data is not immediately released but is retained for future writes.
To release the space immediately, you are advised to run OPTIMIZE TABLE tableName during off-peak hours.
Comparison Between ANALYZE TABLE and OPTIMIZE TABLE
Item | ANALYZE TABLE | OPTIMIZE TABLE |
|---|---|---|
Description | This statement updates table statistics. It is usually used to address issues such as SQL queries choosing incorrect indexes due to outdated statistics. | This statement not only updates statistics but also releases fragmented space. It is usually used to address excessive fragmented space in a table. |
Execution Duration | Within seconds | The duration depends on the table data volume, instance specifications, and workloads. You are advised to execute this statement during off-peak hours. |
Table Locking Duration | Within seconds | Within seconds |
Feedback
Was this page helpful?
Provide feedbackThank 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
