system-table-disk-usages

Retrieves disk usage for table data files by partition.

Command properties

PropertyDescription
Command typeDriver query
Required permissionNone
License usageNot counted
Parallel executionNot supported
Distributed executionNot supported

Syntax

system-table-disk-usages [duration=INT{mon|w|d|h|m|s}] [from=DATE] [to=DATE] [TABLE_LIST]

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), or s (second). For example, 10s means the last 10 seconds relative to query execution time.
from=DATE
Start date of the retrieval range, in yyyyMMdd format. The specified date is included in the results. If not specified, all dates are queried.
to=DATE
End date of the retrieval range, in yyyyMMdd format. 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

FieldTypeDescription
_timetimestampPartition date
tablestringTable name
eralongPartition identifier
sklongPartition sub-key. Deprecated.
sto_classintegerInteger value indicating the storage partition lifecycle. 09,999: Hot tier, 10,00019,999: Warm tier, 20,00029,999: Cold tier
disk_usagelongDisk usage (bytes)

Error codes

Parsing errors
Error codeMessageDescription
95030Invalid from value.The from value is invalid
95031Invalid to value.The to value is invalid
95032Invalid 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

  1. Retrieve disk usage for all tables

    system-table-disk-usages
    

    Retrieves disk usage by partition for all tables for which you have read permission.

  2. Retrieve disk usage for a specific table

    system-table-disk-usages sys_cpu_logs
    

    Retrieves disk usage by partition for the sys_cpu_logs table.

  3. Retrieve disk usage for a specific date range

    system-table-disk-usages from=20260301 to=20260317 sys_cpu_logs
    

    Retrieves disk usage by partition for the sys_cpu_logs table from March 1, 2026 to March 17, 2026.

  4. 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_bytes
    

    Retrieves total disk usage by table for the last 7 days, sorted in descending order.