This topic describes how to execute the SHOW COLUMNAR STATUS
statement to view the data volume of column store nodes in the current database.
Usage notes
The version of your PolarDB cluster must be 5.4.19-16989811 or later.
Syntax
SHOW COLUMNAR STATUS
Example
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 following table describes the columns specified in the preceding example.
Column | Description |
TSO | The latest TSO submitted for In-Memory Column Indexes (IMCIs). |
SCHEMA_NAME | The name of the database. |
TABLE_NAME | The name of the table. |
INDEX_NAME | The name of the IMCI. |
ID | The unique ID of the IMCI. |
ROWS | The number of rows in IMCIs recorded in files. |
CSV_FILES | The number of append objects. |
ORC_FILES | The number of ORC files that store IMCIs. |
DEL_FILES | The number of files that store data related to deleted row markers. |
FILES_SIZE | The sum of all object sizes. Unit: B. |
A TSO indicates the most recent point in time that is submitted for IMCIs. In the example, statistics are collected for all tables for which IMCIs are valid in the database until the TSO. Each TSO corresponds to a snapshot version, which is numbered in ascending order.
Statistics are displayed only for created IMCIs.
FAQ
Why does the number of files of different types change? Compaction operations are performed on IMCIs to ensure that data in files is sorted by sort key. The operations include converting append objects into ORC files and performing range sorting between ORC files.
Why do append objects exist in the CSV_FILES directory when data is not updated for a period of time? A compaction operation is triggered to convert append objects in the CSV_FILES directory into columnar storage files only when the number of append objects reaches the specified threshold. A type of files may be retained in each partition. The number of files of this type depends on the execution speed of the compaction operation in the background.
What is the role of the ID column? You do not need to focus on the ID column. This column corresponds only to the unique ID of an IMCI and has global uniqueness. This column is used by the columnar storage engine to distinguish IMCIs. This column resolves issues, such as having the same name for IMCIs and deleting and then re-creating IMCIs that have the same name. When an IMCI is deleted and then re-created, the name of the IMCI remains unchanged. However, the unique ID of the IMCI changes.
What do I do if the number of rows in an IMCI is inconsistent with that of the primary table returned by the SELECT COUNT (*) statement? Check whether the IMCI is synchronized to the latest position of binary log files. You can execute the SHOW COLUMNAR OFFSET statement to query the synchronization position of the IMCI. If the IMCI is synchronized to the latest position, but the number of rows in the IMCI is inconsistent with that of the primary table, contact technical support.