How Can I Clear and Reclaim the Storage Space?
After you delete data stored in GaussDB(DWS) data warehouses, dirty data may be generated possibly because the disk space is not released. This results in disk space waste and deteriorates snapshot creation and restoration performance. The following describes the impact on the system and subsequent operation to clear the disk space:
Points worth mentioning during clearing and reclaiming storage space:
- Unnecessary data needs to be deleted to release the storage space.
- Frequent read and write operations may affect proper database use. Therefore, it is good practice to clear and reclaim the storage space when not in peak hours.
- The data clearing time depends on the data stored in the database.
Perform the following steps to clear and reclaim the storage space:
- Connect to the database. For details, see Methods of Connecting to a Cluster.
- Run the following command to clear and reclaim the storage space:
By default, tables the current user has the permission on are deleted. Other tables are skipped.
The following information is displayed once the space is cleared:
1
VACUUM
- VACUUM FULL reclaims all expired row space, however it requires an exclusive lock on each table being processed, and might take a long time to complete on large, distributed database tables. You are advised to do VACUUM FULL to specified tables. If you want to do VACUUM FULL to the entire database, you are advised to do it during database maintenance.
- The statistical information will be lost if you use the FULL parameter. To collect the statistics, add keyword ANALYZE, for example, VACUUM FULL ANALYZE;.
For more information about VACUUM, see VACUUM in the SQL Syntax Reference.
Cluster Management FAQs
- What Do I Do If Creating a GaussDB(DWS) Cluster Failed?
- How Can I Clear and Reclaim the Storage Space?
- Can I Switch My Cluster Nodes to Another Region After Purchase?
- Why Did the Used Storage Shrink After Scale-out?
- How Do I View Node Metrics (CPU, Memory, and Disk Usage)?
- Does GaussDB(DWS) Support a Single Node for a Learning Environment?
- Does GaussDB(DWS) Support BMS?
- How Is the Disk Space or Capacity of GaussDB(DWS) Calculated?
- What Are the gaussdb and postgres Databases of GaussDB(DWS)?
- How Do I Set the Maximum Number of Sessions When Adding an Alarm Rule on Cloud Eye?
- How Do I Determine Whether a Cluster Uses the x86 or Arm Architecture?
- What Should I Do If the Scale-out Check Fails?
- When Should I Add CNs or Scale out a cluster?
- What Are the Scenarios of Resizing a Cluster, Changing the Node Flavor, Scale-out, and Scale-in?
- How Should I Select from a Small-Flavor Many-Node Cluster and a Large-Flavor Three-Node Cluster with Same CPU Cores and Memory?
- What Are the Differences Between Cloud SSDs and Local SSDs?
- What Are the Differences Between Hot Data Storage and Cold Data Storage?
- What Do I do if the Scale-in Button Is Dimmed?
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.
Chatbotmore