How Do I View Used Storage of My GaussDB(for MySQL) Instance?
GaussDB(for MySQL) decouples compute and storage, so data is stored in the shared storage. You can view the used storage of your instance on the console and the used storage is updated every 30 minutes.
Procedure
- Log in to the management console.
- Click in the upper left corner and select a region and a project.
- Click in the upper left corner of the page, choose .
- On the Instances page, click the instance name to go to the Basic Information page.
- In the Storage/Backup Space area, view the used storage of your instance.
Storage is calculated differently for GaussDB(for MySQL) and open-source MySQL. To query used storage of an open-source MySQL instance: run select sum(data_length+index_length+data_free) from information_schema.tables;
To query used storage of a GaussDB(for MySQL) instance, log in to GaussDB(for MySQL) console or run show spaceusage;.
Figure 1 Viewing the storage of a DB instance
- Shared storage:
- The total and used storage of your yearly/monthly instance is displayed.
- If this storage is used up, storage grows as data volume increases and you will be billed on a pay-per-use basis for any additional storage. To keep costs down, make sure you scale up storage in a timely manner so you can take advantage of yearly/monthly rates.
- Backup space:
GaussDB(for MySQL) provides free backup storage equal to the amount of the used storage of your pay-per-use instances or the purchased storage of your yearly/monthly instance.
- Shared storage:
Item |
Command |
Description |
Table data |
select sum(data_length+index_length+data_free) from information_schema.tables; |
Size of table data. If the statistics data is not updated, the result may be inaccurate. Open-source MySQL uses this command to obtain the used storage of a DB instance. |
Pre-allocated table space |
select count(*) from information_schema.tables; |
Pre-allocated space of tables. The statement is used to query the number of tables and the total pre-allocated space of tables is (Number of tables X 4 MB). The system pre-allocates 4 MB of storage to each table. |
Pre-allocated partition space |
select count(*) from INFORMATION_SCHEMA.PARTITIONS where PARTITION_NAME is not null; |
Pre-allocated space of partitions. The statement is used to query the number of partitions and the total pre-allocated space of partitions is (Number of partitions X 4 MB). The system pre-allocates 4 MB of storage to each partition. |
Binlog |
show binary logs; |
Total size of all binlog files. |
Redolog |
show lsninfo; |
flushed_to_disk_lsn- truncate_lsn |
Undolog |
N/A |
Size of undo logs. To obtain it, contact the customer service. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.