Note
This view is available starting with V4.0.0.
Purpose
This view displays the information about index columns of index tables in all tenants.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| CON_ID | decimal(10,0) | NO | The tenant ID. |
| INDEX_OWNER | varchar(128) | NO | The owner of the index. |
| INDEX_NAME | varchar(128) | NO | The name of the index. |
| TABLE_OWNER | varchar(128) | NO | The owner of the table to which the index belongs. |
| TABLE_NAME | varchar(128) | NO | The name of the table to which the index belongs. |
| COLUMN_NAME | text | NO | The name of the index column. |
| COLUMN_POSITION | bigint(20) | NO | The position of the index column in the index. |
| COLUMN_LENGTH | bigint(20) | NO | The length of the index column. |
| CHAR_LENGTH | bigint(20) | NO | The length of the index column in characters. |
| DESCEND | varchar(4) | NO | Indicates whether the index column is sorted in descending (DESC) or ascending (ASC) order. |
| COLLATED_COLUMN_ID | bigint(0) | NO | This column is not supported and is always NULL. |
Sample query
In the sys tenant, query the information about index columns of the tbl9 index table in the tenant with ID 1002.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_IND_COLUMNS WHERE CON_ID=1002 AND TABLE_NAME='tbl9';
The query result is as follows:
+--------+-------------+------------------+-------------+------------+-------------+-----------------+---------------+-------------+---------+--------------------+
| CON_ID | INDEX_OWNER | INDEX_NAME | TABLE_OWNER | TABLE_NAME | COLUMN_NAME | COLUMN_POSITION | COLUMN_LENGTH | CHAR_LENGTH | DESCEND | COLLATED_COLUMN_ID |
+--------+-------------+------------------+-------------+------------+-------------+-----------------+---------------+-------------+---------+--------------------+
| 1002 | infotest | t_pk_obpk_500019 | infotest | tbl9 | id | 1 | 22 | 0 | ASC | NULL |
| 1002 | infotest | tbl9_idx1 | infotest | tbl9 | date | 1 | 0 | 0 | ASC | NULL |
+--------+-------------+------------------+-------------+------------+-------------+-----------------+---------------+-------------+---------+--------------------+
2 rows in set