Queries Clustered Columnar Indexes (CCIs) that have been created or are being created on a PolarDB-X instance.
Prerequisites
Before you begin, ensure that you have:
A PolarDB-X instance running version 5.4.19-16989811 or later
Syntax
SHOW COLUMNAR {INDEX | INDEXES} [FROM [schema_name.]tbl_name]schema_name and tbl_name are optional. Use them to filter by table name or to query tables in a different database.
Examples
Query all CCIs in the current database
SHOW COLUMNAR INDEX;Query the CCIs of a specific table
SHOW COLUMNAR INDEX FROM xxx_tb;Query the CCIs of a table in a different database
SHOW COLUMNAR INDEX FROM xxx_db.xxx_tb;Output
Running SHOW COLUMNAR INDEX returns a result set similar to the following:
+---------------+---------+-------------------+-----------+-----------+----------------+---------------+--------------------+-----------------+-----------+--------+
| SCHEMA | TABLE | INDEX_NAME | CLUSTERED | PK_NAMES | COVERING_NAMES | PARTITION_KEY | PARTITION_STRATEGY | PARTITION_COUNT | SORT_KEY | STATUS |
+---------------+---------+-------------------+-----------+-----------+----------------+---------------+--------------------+-----------------+-----------+--------+
| columnar_test | t_order | cc_i_seller_$07f0 | true | id | | order_id | DIRECT_HASH | 16 | seller_id | PUBLIC |
+---------------+---------+-------------------+-----------+-----------+----------------+---------------+--------------------+-----------------+-----------+--------+The following table describes each column in the output.
| Column | Description |
|---|---|
SCHEMA | The name of the database. |
TABLE | The name of the table. |
INDEX_NAME | The name of the index. |
CLUSTERED | Specifies whether the index is a covered index. Valid value: true. |
PK_NAMES | The primary key column. |
COVERING_NAMES | The covering column. |
PARTITION_KEY | The partition key column. |
PARTITION_STRATEGY | The partitioning type. For example, DIRECT_HASH. |
PARTITION_COUNT | The number of partitions. |
SORT_KEY | The sort key. |
STATUS | The status of the index. Valid values: CREATING (the index is being built) and PUBLIC (the index is built and available for queries). |
What's next
To view general index information, use the SHOW INDEX statement.