system-table-partitions

Retrieves the record count stored in tables by partition.

Command properties

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

Syntax

system-table-partitions [duration=INT{mon|w|d|h|m|s}] [from=DATE] [to=DATE] [diskonly=BOOL] [era=LONG] [TABLE_PATTERN]

Options

duration=INT{mon|w|d|h|m|s}
Retrieves only partitions within the specified time range from the current time. 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 start 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.
diskonly=BOOL
Specifies what to count. (Default: f)
  • t: Count only records written to disk
  • f: Include records buffered in memory
era=LONG
Specifies a partition identifier. If specified, only the partition with that identifier is retrieved. If not specified, all partitions are retrieved.
TABLE_PATTERN
Name pattern 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, all tables for which you have read permission are retrieved.

Output fields

FieldTypeDescription
_timetimestampPartition date
skstringPartition sub-key (hexadecimal). Deprecated.
eralongPartition identifier
tablestringTable name
countlongNumber of records in the partition
sto_classintegerInteger value indicating the storage partition lifecycle. 0–9,999: Hot tier, 10,000–19,999: Warm tier, 20,000–29,999: Cold tier
sto_pathstringStorage path or URI

Error codes

Parsing errors
Error codeMessageDescription
95030Invalid from value.The from option value cannot be parsed as a date
95031Invalid to value.The to option value cannot be parsed as a date
95032Invalid from value.The to value is earlier than the from value
95150Invalid partition identifier format: [era]. Use a decimal integer.The era option value is not a valid integer
Runtime errors

N/A

Description

The system-table-partitions command retrieves the record count stored in tables by partition. It returns the date, table name, record count, storage class, and storage path for each partition.

By default, records buffered in memory are also included. Specify diskonly=t to count only records written to disk.

Users without administrator privileges can only query tables for which they have read permission.

Examples

  1. Retrieve partition-level record counts for all tables

    system-table-partitions
    

    Retrieves partition-level record counts for all tables for which you have read permission.

  2. Retrieve partition-level record counts for a specific table

    system-table-partitions sys_cpu_logs
    

    Retrieves partition-level record counts for the sys_cpu_logs table.

  3. Retrieve only partitions within the last 7 days

    system-table-partitions duration=7d sys_cpu_logs
    

    Retrieves partition-level record counts for the sys_cpu_logs table within the last 7 days.

  4. Retrieve by specifying a date range

    system-table-partitions from=20260301 to=20260317 sys_cpu_logs
    

    Retrieves partition-level record counts for the sys_cpu_logs table from March 1, 2026 to March 17, 2026.

  5. Retrieve only records written to disk

    system-table-partitions diskonly=t sys_cpu_logs
    

    Retrieves only the record count written to disk, excluding memory buffers.

  6. Sum total record count by table

    system-table-partitions | stats sum(count) as total_count by table
    

    Sums the total record count for each table.