Note
This view is available starting with V1.4.
Purpose
The information_schema.STATISTICS view records table index information.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(512) | NO | Fixed value (def) |
| TABLE_SCHEMA | varchar(128) | NO | Database name |
| TABLE_NAME | varchar(256) | NO | Table name |
| NON_UNIQUE | bigint(20) | NO | Indicates whether the index is unique. |
| INDEX_SCHEMA | varchar(128) | NO | Database name |
| INDEX_NAME | varchar(256) | NO | Index name |
| SEQ_IN_INDEX | bigint(20) unsigned | NO | Index number |
| COLUMN_NAME | varchar(128) | NO | Column name |
| COLLATION | varchar(1) | NO | Comparison method |
| CARDINALITY | bigint(0) | NO | Default value is NULL. |
| SUB_PART | bigint(20) | NO | The number of characters indexed if only part of the column is indexed. NULL if the entire column is indexed. |
| PACKED | varchar(10) | NO | Default value is NULL. |
| NULLABLE | varchar(3) | NO | Indicates whether the column can be NULL. |
| INDEX_TYPE | varchar(16) | NO | Data structure type used for the index. |
| COMMENT | varchar(16) | NO | Index comment or description.
NoteThis column started to display the actual index status instead of NULL starting with V4.3.1. |
| INDEX_COMMENT | text | NO | Index comment |
| IS_VISIBLE | varchar(3) | NO | Indicates whether the index is visible. |
| EXPRESSION | varbinary(262144) | NO | Used for MySQL compatibility. Value is NULL.
NoteThis column was introduced in V4.2.1. |
Sample query
Query table index information.
obclient [none]> SELECT * FROM information_schema.STATISTICS limit 1 \G
The query result is as follows:
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: oceanbase
TABLE_NAME: __all_table_history
NON_UNIQUE: 1
INDEX_SCHEMA: oceanbase
INDEX_NAME: idx_data_table_id
SEQ_IN_INDEX: 1
COLUMN_NAME: data_table_id
COLLATION: A
CARDINALITY: NULL
SUB_PART: NULL
PACKED: NULL
NULLABLE: YES
INDEX_TYPE: BTREE
COMMENT: VALID
INDEX_COMMENT:
IS_VISIBLE: YES
EXPRESSION: NULL
1 row in set (0.003 sec)
