Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
This view displays the indexed columns of the index tables of all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | decimal(10,0) | NO | The ID of the tenant. |
| 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 containing the index. |
| TABLE_NAME | varchar(128) | NO | The name of the table containing the index. |
| COLUMN_NAME | text | NO | The name of the indexed column. |
| COLUMN_POSITION | bigint(20) | NO | The position of the indexed column in the index. |
| COLUMN_LENGTH | bigint(20) | NO | The length of the indexed column. |
| CHAR_LENGTH | bigint(20) | NO | The character length of the indexed column. |
| DESCEND | varchar(4) | NO | Indicates whether the column is sorted in descending order or ascending order. |
| COLLATED_COLUMN_ID | bigint(0) | NO | At present, this column is not supported and is NULL by default. |
Sample query
Under the system tenant, query the index column information of the index table tbl9 for the tenant with tenant 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