system-table-partitions
Retrieves the record count stored in tables 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 partitions within the specified time range from the current time. 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 start 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. diskonly=BOOL- Specifies what to count. (Default:
f)t: Count only records written to diskf: 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
| Field | Type | Description |
|---|---|---|
| _time | timestamp | Partition date |
| sk | string | Partition sub-key (hexadecimal). Deprecated. |
| era | long | Partition identifier |
| table | string | Table name |
| count | long | Number of records in the partition |
| 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 |
| sto_path | string | Storage path or URI |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95030 | Invalid from value. | The from option value cannot be parsed as a date |
| 95031 | Invalid to value. | The to option value cannot be parsed as a date |
| 95032 | Invalid from value. | The to value is earlier than the from value |
| 95150 | Invalid 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
-
Retrieve partition-level record counts for all tables
system-table-partitionsRetrieves partition-level record counts for all tables for which you have read permission.
-
Retrieve partition-level record counts for a specific table
system-table-partitions sys_cpu_logsRetrieves partition-level record counts for the
sys_cpu_logstable. -
Retrieve only partitions within the last 7 days
system-table-partitions duration=7d sys_cpu_logsRetrieves partition-level record counts for the
sys_cpu_logstable within the last 7 days. -
Retrieve by specifying a date range
system-table-partitions from=20260301 to=20260317 sys_cpu_logsRetrieves partition-level record counts for the
sys_cpu_logstable from March 1, 2026 to March 17, 2026. -
Retrieve only records written to disk
system-table-partitions diskonly=t sys_cpu_logsRetrieves only the record count written to disk, excluding memory buffers.
-
Sum total record count by table
system-table-partitions | stats sum(count) as total_count by tableSums the total record count for each table.