system-index-blocks
Retrieves partition and segment-level metadata for table indexes. The terms, termlimit, blocklimit, and blockoffset options themselves are available in both series. Merged indexes — the merged-segment rows, the posting_offset term field, and the way blocklimit/blockoffset span a partition's regular and merged segments as one combined stream — are available starting with 4.0.2609.0. The 5.0 series (through 5.0.2605.2) has no merged indexes, so this command returns only regular (V3) segment rows there.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | None (table read permission required) |
| License usage | Not counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
Options
table=TABLE- Name of the table to query. This option is required.
index=INDEX- Name of the index to query. This option is required.
day=DATE- Partition date in
yyyyMMddformat. If not specified, all partitions are queried. sk=HEX- Partition sub-key as a hexadecimal
longvalue. If not specified, the retrieval range is not restricted. era=LONG- Partition identifier. If not specified, the retrieval range is not restricted.
terms={t|f}- Retrieves term data for each index field. (Default:
f)
t: Include term data in the resultsf: Do not retrieve term data
termlimit=LONG- When
terms=t, limits the number of term rows returned. Must be used together withterms=t. For a regular (V3) segment, this limit is applied per field; for a merged segment, it is applied per tree kind (string, integer, timestamp, IPv4, IPv6). blocklimit=LONG- Limits the maximum number of segments (blocks) to retrieve. This is applied to the combined stream of a partition's regular (V3) segments and merged segments (if multiple partitions are queried, this limit is applied separately to each partition).
blockoffset=LONG- Specifies the starting position of segments to retrieve. (Default:
0) This skips from the front of the combined stream of a partition's regular (V3) segments and merged segments, applied separately per partition.
Output fields
Base segment information fields:
| Field | Type | Description |
|---|---|---|
| table | string | Table name |
| index | string | Index name |
| partition | string | Partition identifier string |
| sto_class | integer | Storage class number. 0–9,999: Hot tier, 10,000–19,999: Warm tier, 20,000–29,999: Cold tier |
| sto_path | string | Absolute path of the directory where segment files are stored. For a merged-segment row, this is the absolute path of the .merged directory. |
| seg_id | long | Segment ID. Not returned for a merged-segment row (null). |
| min_id | long | Minimum record ID in the segment. Not returned when reserved is true or for a merged-segment row (null). |
| max_id | long | Maximum record ID in the segment. Not returned when reserved is true. For a merged-segment row, this returns the overall maximum record ID indexed, or null if it cannot be determined. |
| min_time | timestamp | Minimum timestamp in the segment. Not returned for a merged-segment row (null). |
| max_time | timestamp | Maximum timestamp in the segment. Not returned for a merged-segment row (null). |
| ver | long | Segment version. Not returned when reserved is true. For a merged-segment row, this returns 4 (the merged index version). |
| reserved | boolean | Whether the segment is reserved. Not returned for a merged-segment row (null). |
| field_cnt | integer | Number of fields in the segment |
| seg_offset | long | Start offset of the segment data. Not returned for a merged-segment row (null). |
| fields | string | List of fields. Displayed per line in fieldname:type:termblocksize format. For a merged-segment row, this uses the same format to display fieldname:type:posting file size (bytes). |
Additional fields returned when terms=t is specified:
| Field | Type | Description |
|---|---|---|
| field_name | string | Name of the field the term belongs to |
| field_type | string | Field type (one of STRING, INT, TIME, IPV4, IPV6) |
| term | string or long | Term value |
| posting_count | long | Number of records containing the term |
| posting_offset | long | Start offset of the term's posting data. Returned only for a term row from a merged segment; not returned for a term row from a regular (V3) segment (null). |
A term row from a regular (V3) segment returns only seg_id, field_name, field_type, term, and posting_count. A term row from a merged segment returns these plus table, index, partition, sto_class, sto_path, and posting_offset, with one row returned per term-and-field pair (for example, when the same term appears in multiple fields).
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 95061 | missing-table-option | Table name was not specified |
| 95062 | missing-index-option | Index name was not specified |
| 95063 | invalid-table-name | Table name is invalid |
| 95064 | no-table-read-permission | The user does not have read permission for the table |
| 95113 | invalid-day-option | The day value is not in yyyyMMdd format |
| 95114 | invalid-sk-option | The sk value is not a valid hexadecimal long |
| 95115 | invalid-era-option | The era value is invalid |
| 95117 | invalid-long-value | The termlimit, blocklimit, or blockoffset value is invalid |
| 95118 | termlimit-option-given-without-terms | termlimit was specified without terms=t |
Runtime errors
| Error code | Message | Description | Post-processing |
|---|---|---|---|
| 95064 | no-table-read-permission | The user does not have read permission for the table | Query aborted |
| 92003 | table-not-exist | The specified table does not exist | Query aborted |
| 92005 | missing-index | The specified index does not exist | Query aborted |
Description
The system-index-blocks command retrieves segment-level metadata for table indexes. You can view each segment's ID, timestamp range, storage class, storage path, and field information.
If the queried partition has a merged index (a .merged directory), merged-segment rows are returned together with the regular (V3) segment rows in the same query result. A merged-segment row is not per individual segment; one row is returned per tree kind in the merged index (string, integer, timestamp, IPv4, IPv6), and the seg_id, min_id, min_time, max_time, reserved, and seg_offset fields are not returned for these rows (null).
When the terms=t option is specified, term data for each field is also returned in addition to the segment records. The termlimit option limits the number of term rows and must be used together with terms=t. This limit is applied separately per field for regular (V3) segments, and per tree kind for merged segments.
Use the blocklimit and blockoffset options to restrict the range of segments to retrieve, enabling paginated retrieval of large indexes. Both options are applied to the combined stream of a partition's regular (V3) segments and merged segments — if multiple partitions are queried, the limit is applied separately to each partition, and it does not directly limit the total number of result rows.
Examples
-
Retrieve segments for a specific table index
system-index-blocks table=SONAR_EVENTS index=default_idxRetrieves the segment list for the
default_idxindex of theSONAR_EVENTStable. -
Retrieve segments for a specific date partition
system-index-blocks table=SONAR_EVENTS index=default_idx day=20260301Retrieves segments for the March 1, 2026 partition of the
default_idxindex in theSONAR_EVENTStable. -
Retrieve with term data included
system-index-blocks table=SONAR_EVENTS index=default_idx day=20260301 terms=t termlimit=10Retrieves segments for the March 1, 2026 partition along with up to 10 term entries per field.
-
Retrieve with a segment count limit
system-index-blocks table=SONAR_EVENTS index=default_idx blocklimit=100Retrieves up to 100 segments for the
default_idxindex of theSONAR_EVENTStable. -
Retrieve only merged segments (4.0 series, 4.0.2609.0 and later)
system-index-blocks table=SONAR_EVENTS index=default_idx | search ver == 4
Change history
| Target | Introduced in |
|---|---|
The system-index-blocks command | Before Sonar 4.0 |
| Returning merged segment rows | 4.0.2609.0 |
Applying the blockoffset and blocklimit options to the unified stream | 4.0.2609.0 |
The posting_offset field of terms=t | 4.0.2609.0 |