All Products
Search
Document Center

PolarDB:SHOW COLUMNAR INDEX

Last Updated:Apr 09, 2024

This topic describes how to use the SHOW COLUMNAR INDEX statement to query Clustered Columnar Indexes (CCIs) that have been created or are being created.

Usage notes

The version of your PolarDB-X instance is 5.4.19-16989811 or later.

Syntax

SHOW COLUMNAR {INDEX | INDEXES} [FROM [schema_name.]tbl_name]
Note

schema_name and tbl_name are optional parameters. These parameters are used to filter table names or query information about tables on other databases.

Sample statements:

SHOW COLUMNAR INDEX; # Query the CCIs of all tables on the current database
SHOW COLUMNAR INDEX FROM xxx_tb; # Query the CCIs of the xxx_tb table on the current database
SHOW COLUMNAR INDEX FROM xxx_db.xxx_tb; # Query the CCIs of the xxx_tb table on the xxx_db database (for across-database query)

You can also execute the SHOW INDEX statement to view index information. For more information, see SHOW INDEX.

Examples

SHOW COLUMNAR INDEX;
+---------------+---------+-------------------+-----------+-----------+----------------+---------------+--------------------+-----------------+-----------+--------+
| 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 the parameters in returned results.

Parameter

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_STRATEGY

The partitioning type.

PARTITION_COUNT

The number of partitions.

SORT_KEY

The sort key

STATUS

The status of the index. Valid values:

  • CREATING

  • PUBLIC