system-table-disk-usages
Retrieves disk usage for table data files by partition.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | None |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
Options
duration=INT{mon|w|d|h|m|s}- Retrieves only recent data within the specified time period. Use units
mon(month),w(week),d(day),h(hour),m(minute), ors(second). For example,10smeans the last 10 seconds relative to query execution time. from=DATE- Start date of the retrieval range, in
yyyyMMddformat. The specified date is included in the results. If not specified, all dates are queried. to=DATE- End date of the retrieval range, in
yyyyMMddformat. The specified date is included in the results. If not specified, all dates are queried. TABLE_LIST- List of tables to retrieve. Separate multiple tables with a comma (
,). You can use a wildcard (*) at the beginning or end of the name. If not specified, disk usage is retrieved for all tables for which you have read permission.
Output fields
| Field | Type | Description |
|---|---|---|
| _time | timestamp | Partition date |
| table | string | Table name |
| era | long | Partition identifier |
| sk | long | Partition sub-key. Deprecated. |
| sto_class | integer | Integer value indicating the storage partition lifecycle. 0–9,999: Hot tier, 10,000–19,999: Warm tier, 20,000–29,999: Cold tier |
| disk_usage | long | Disk usage (bytes) |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95030 | Invalid from value. | The from value is invalid |
| 95031 | Invalid to value. | The to value is invalid |
| 95032 | Invalid from value. | The from value is later than the to value |
Runtime errors
N/A
Description
The system-table-disk-usages command retrieves disk usage for data files of each table by partition. Only tables for which you have read permission can be queried.
Use the from and to options to query specific date partitions, or use the duration option to query recent partitions relative to the current time. Tables that do not exist are excluded from the results.
Examples
-
Retrieve disk usage for all tables
system-table-disk-usagesRetrieves disk usage by partition for all tables for which you have read permission.
-
Retrieve disk usage for a specific table
system-table-disk-usages sys_cpu_logsRetrieves disk usage by partition for the
sys_cpu_logstable. -
Retrieve disk usage for a specific date range
system-table-disk-usages from=20260301 to=20260317 sys_cpu_logsRetrieves disk usage by partition for the
sys_cpu_logstable from March 1, 2026 to March 17, 2026. -
Aggregate total disk usage by table for the last 7 days
system-table-disk-usages duration=7d | stats sum(disk_usage) as total_bytes by table | order -total_bytesRetrieves total disk usage by table for the last 7 days, sorted in descending order.