Overview
Displays the index column information for index tables of all tenants.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| CON_ID | decimal(10,0) | NO | Tenant ID |
| INDEX_OWNER | varchar(128) | NO | Owner of the index |
| INDEX_NAME | varchar(128) | NO | Index Name |
| TABLE_OWNER | varchar(128) | NO | Owner of the table containing the index |
| TABLE_NAME | varchar(128) | NO | The name of the table where the index is located. |
| COLUMN_NAME | text | NO | Name of the index column |
| COLUMN_POSITION | bigint(20) | NO | The position of the index column in the index |
| COLUMN_LENGTH | bigint(20) | NO | Length of index column |
| CHAR_LENGTH | bigint(20) | NO | Character length of index columns |
| DESCEND | varchar(4) | NO | Specifies whether the index column is sorted in descending order (DESC) or ascending order (ASC). |
| COLLATED_COLUMN_ID | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
Sample query
In the sys tenant, view the index column information of the index table tbl9 for 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