Note
This view was introduced in OceanBase Database V4.0.0.
Purpose
The oceanbase.CDB_INDEXES view displays the indexes of all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | bigint(20) | NO | The ID of the tenant. |
| OWNER | varchar(128) | NO | The owner of the index. |
| INDEX_NAME | varchar(128) | NO | The name of the index. |
| INDEX_TYPE | varchar(27) | NO | The type of the index. |
| TABLE_OWNER | varchar(128) | NO | The owner of the indexed object. |
| TABLE_NAME | varchar(128) | NO | The name of the indexed object. |
| TABLE_TYPE | varchar(5) | NO | The type of the indexed object. |
| UNIQUENESS | varchar(9) | NO | Indicates whether the index is unique. |
| COMPRESSION | varchar(13) | NO | Indicates whether the index is compressed. |
| PREFIX_LENGTH | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| TABLESPACE_NAME | varchar(30) | NO | The name of the tablespace containing the index. |
| INI_TRANS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| MAX_TRANS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| INITIAL_EXTENT | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| NEXT_EXTENT | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| MIN_EXTENTS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| MAX_EXTENTS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| PCT_INCREASE | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| PCT_THRESHOLD | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| INCLUDE_COLUMN | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| FREELISTS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| FREELIST_GROUPS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| PCT_FREE | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| LOGGING | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| BLEVEL | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| LEAF_BLOCKS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| DISTINCT_KEYS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| AVG_LEAF_BLOCKS_PER_KEY | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| AVG_DATA_BLOCKS_PER_KEY | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| CLUSTERING_FACTOR | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| STATUS | varchar(8) | NO | Indicates whether the nonpartitioned index is valid or unusable. |
| NUM_ROWS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| SAMPLE_SIZE | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| LAST_ANALYZED | date | NO | At present, this column is not supported and its value is NULL by default. |
| DEGREE | varchar(40) | NO | At present, this column is not supported and its value is NULL by default. |
| INSTANCES | varchar(40) | NO | At present, this column is not supported and its value is NULL by default. |
| PARTITIONED | varchar(3) | NO | Indicates whether the index is a partitioned index. |
| TEMPORARY | varchar(1) | NO | At present, this column is not supported and its value is NULL by default. |
| GENERATED | varchar(1) | NO | At present, this column is not supported and its value is NULL by default. |
| SECONDARY | varchar(1) | NO | At present, this column is not supported and its value is NULL by default. |
| BUFFER_POOL | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| FLASH_CACHE | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| CELL_FLASH_CACHE | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| USER_STATS | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| DURATION | varchar(15) | NO | At present, this column is not supported and its value is NULL by default. |
| PCT_DIRECT_ACCESS | decimal(10,0) | NO | At present, this column is not supported and its value is NULL by default. |
| ITYP_OWNER | varchar(128) | NO | At present, this column is not supported and its value is NULL by default. |
| ITYP_NAME | varchar(128) | NO | At present, this column is not supported and its value is NULL by default. |
| PARAMETERS | text | NO | At present, this column is not supported and its value is NULL by default. |
| GLOBAL_STATS | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| DOMIDX_STATUS | varchar(12) | NO | At present, this column is not supported and its value is NULL by default. |
| DOMIDX_OPSTATUS | varchar(6) | NO | At present, this column is not supported and its value is NULL by default. |
| FUNCIDX_STATUS | varchar(8) | NO | The status of the function-based index. |
| JOIN_INDEX | varchar(3) | NO | Indicates whether the index is a join index. |
| IOT_REDUNDANT_PKEY_ELIM | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| DROPPED | varchar(3) | NO | Indicates whether the index has been dropped and moved to the recycle bin. |
| VISIBILITY | varchar(9) | NO | Indicates whether the index is visible to the optimizer. |
| DOMIDX_MANAGEMENT | varchar(14) | NO | At present, this column is not supported and its value is NULL by default. |
| SEGMENT_CREATED | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| ORPHANED_ENTRIES | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| INDEXING | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| AUTO | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
Sample query
Query the index information of the tbl9 table in the tenant with tenant ID 1002.
obclient [oceanbase]> SELECT * FROM CDB_INDEXES WHERE CON_ID=1002 AND TABLE_NAME='tbl9'\G
The query result is as follows:
*************************** 1. row ***************************
CON_ID: 1002
OWNER: infotest
INDEX_NAME: t_pk_obpk_500019
INDEX_TYPE: NORMAL
TABLE_OWNER: infotest
TABLE_NAME: tbl9
TABLE_TYPE: TABLE
UNIQUENESS: UNIQUE
COMPRESSION: ENABLED
PREFIX_LENGTH: NULL
TABLESPACE_NAME: NULL
INI_TRANS: NULL
MAX_TRANS: NULL
INITIAL_EXTENT: NULL
NEXT_EXTENT: NULL
MIN_EXTENTS: NULL
MAX_EXTENTS: NULL
PCT_INCREASE: NULL
PCT_THRESHOLD: NULL
INCLUDE_COLUMN: NULL
FREELISTS: NULL
FREELIST_GROUPS: NULL
PCT_FREE: NULL
LOGGING: NULL
BLEVEL: NULL
LEAF_BLOCKS: NULL
DISTINCT_KEYS: NULL
AVG_LEAF_BLOCKS_PER_KEY: NULL
AVG_DATA_BLOCKS_PER_KEY: NULL
CLUSTERING_FACTOR: NULL
STATUS: VALID
NUM_ROWS: NULL
SAMPLE_SIZE: NULL
LAST_ANALYZED: NULL
DEGREE: 1
INSTANCES: NULL
PARTITIONED: NO
TEMPORARY: NULL
GENERATED: NULL
SECONDARY: NULL
BUFFER_POOL: NULL
FLASH_CACHE: NULL
CELL_FLASH_CACHE: NULL
USER_STATS: NULL
DURATION: NULL
PCT_DIRECT_ACCESS: NULL
ITYP_OWNER: NULL
ITYP_NAME: NULL
PARAMETERS: NULL
GLOBAL_STATS: NULL
DOMIDX_STATUS: NULL
DOMIDX_OPSTATUS: NULL
FUNCIDX_STATUS: NULL
JOIN_INDEX: NO
IOT_REDUNDANT_PKEY_ELIM: NULL
DROPPED: NO
VISIBILITY: VISIBLE
DOMIDX_MANAGEMENT: NULL
SEGMENT_CREATED: NULL
ORPHANED_ENTRIES: NULL
INDEXING: NULL
AUTO: NULL
*************************** 2. row ***************************
CON_ID: 1002
OWNER: infotest
INDEX_NAME: tbl9_idx1
INDEX_TYPE: NORMAL
TABLE_OWNER: infotest
TABLE_NAME: tbl9
TABLE_TYPE: TABLE
UNIQUENESS: NONUNIQUE
COMPRESSION: ENABLED
PREFIX_LENGTH: NULL
TABLESPACE_NAME: NULL
INI_TRANS: NULL
MAX_TRANS: NULL
INITIAL_EXTENT: NULL
NEXT_EXTENT: NULL
MIN_EXTENTS: NULL
MAX_EXTENTS: NULL
PCT_INCREASE: NULL
PCT_THRESHOLD: NULL
INCLUDE_COLUMN: NULL
FREELISTS: NULL
FREELIST_GROUPS: NULL
PCT_FREE: NULL
LOGGING: NULL
BLEVEL: NULL
LEAF_BLOCKS: NULL
DISTINCT_KEYS: NULL
AVG_LEAF_BLOCKS_PER_KEY: NULL
AVG_DATA_BLOCKS_PER_KEY: NULL
CLUSTERING_FACTOR: NULL
STATUS: VALID
NUM_ROWS: NULL
SAMPLE_SIZE: NULL
LAST_ANALYZED: NULL
DEGREE: 1
INSTANCES: NULL
PARTITIONED: NO
TEMPORARY: NULL
GENERATED: NULL
SECONDARY: NULL
BUFFER_POOL: NULL
FLASH_CACHE: NULL
CELL_FLASH_CACHE: NULL
USER_STATS: NULL
DURATION: NULL
PCT_DIRECT_ACCESS: NULL
ITYP_OWNER: NULL
ITYP_NAME: NULL
PARAMETERS: NULL
GLOBAL_STATS: NULL
DOMIDX_STATUS: NULL
DOMIDX_OPSTATUS: NULL
FUNCIDX_STATUS: NULL
JOIN_INDEX: NO
IOT_REDUNDANT_PKEY_ELIM: NULL
DROPPED: NO
VISIBILITY: VISIBLE
DOMIDX_MANAGEMENT: NULL
SEGMENT_CREATED: NULL
ORPHANED_ENTRIES: NULL
INDEXING: NULL
AUTO: NULL
2 rows in set