Returns the storage state of In-Memory Column Indexes (IMCIs) in the current database, including row counts, file counts by type, and total object size.
Prerequisites
Before you begin, ensure that you have:
A PolarDB cluster running version 5.4.19-16989811 or later
Syntax
SHOW COLUMNAR STATUSExample
SHOW COLUMNAR STATUS;+---------------------+-------------+------------+--------------------+------+-------+-----------+-----------+-----------+------------+
| TSO | SCHEMA_NAME | TABLE_NAME | INDEX_NAME | ID | ROWS | CSV_FILES | ORC_FILES | DEL_FILES | FILES_SIZE |
+---------------------+-------------+------------+--------------------+------+-------+-----------+-----------+-----------+------------+
| 7127209598129274944 | xxx_db | sbtest1 | s1_col_index_$b243 | 1447 | 10 | 4 | 0 | 0 | 580 |
| 7127209598129274944 | xxx_db | sbtest2 | s2_col_index_$a378 | 1469 | 81910 | 1 | 1 | 1 | 3565100 |
+---------------------+-------------+------------+--------------------+------+-------+-----------+-----------+-----------+------------+The output includes one row per IMCI. Only IMCIs that have been created appear in the results.
Output columns
Core columns
| Column | Description |
|---|---|
TSO | The TSO snapshot at which statistics were collected. All rows in a single result share the same TSO, which represents the most recent point in time submitted to IMCIs. Each TSO value corresponds to a snapshot version, numbered in ascending order. |
SCHEMA_NAME | The name of the database. |
TABLE_NAME | The name of the table. |
INDEX_NAME | The name of the IMCI. |
ROWS | The number of rows recorded across all IMCI files. To verify that the IMCI is fully synchronized with the primary table, run SHOW COLUMNAR OFFSET. |
FILES_SIZE | The total size of all IMCI objects, in bytes. |
File type columns
IMCIs follow a storage lifecycle: new and updated rows land in append objects first, then compaction converts them into sorted ORC files. The three file-type columns reflect where data sits in this lifecycle at the time of the query.
| Column | Description |
|---|---|
CSV_FILES | The number of append objects. Compaction converts these into ORC files once the count reaches the configured threshold. Until that threshold is reached — or while the background compaction job is still running — some append objects remain in each partition. |
ORC_FILES | The number of Optimized Row Columnar (ORC) files storing IMCI data. Data in ORC files is sorted by sort key. Compaction also performs range sorting between existing ORC files, which can change this count. |
DEL_FILES | The number of files that store data related to deleted row markers. |
Internal column
| Column | Description |
|---|---|
ID | The unique ID assigned to this IMCI by the columnar storage engine. This ID has global uniqueness and lets the engine distinguish between IMCIs that share a name — for example, when an IMCI is dropped and re-created under the same name, the name stays the same but the ID changes. This column is for internal use only and does not affect day-to-day operations. |
FAQ
Why do the file counts change over time?
Compaction runs in the background to keep IMCI data sorted by sort key. It converts append objects (CSV_FILES) into ORC files and performs range sorting between existing ORC files. Both operations change the file counts in the output.
Why are there still append objects when no data has been updated recently?
Compaction converts append objects into columnar storage files only after the append object count reaches a configured threshold. Until that threshold is reached — or while the background compaction job is still running — some append objects remain. A small number may persist in each partition regardless.
The IMCI row count doesn't match the primary table. What should I do?
Run SHOW COLUMNAR OFFSET to check whether the IMCI is synchronized to the latest binary log position. If it is synchronized but the row count still doesn't match, contact technical support.