Overview
The information_schema.STATISTICS view is used to record table index information.
Columns
Field Name |
Type |
Whether can be NULL |
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 | Whether it is a unique index |
| 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 | The default value is NULL |
| SUB_PART | bigint(20) | NO | If a column is only partially indexed, the length is the number of characters that are indexed. If the entire column is indexed, the value is NULL. |
| PACKED | varchar(10) | NO | Default value: NULL |
| NULLABLE | varchar(3) | NO | Whether can be NULL |
| INDEX_TYPE | varchar(16) | NO | Data structure type used by index |
| COMMENT | varchar(16) | NO | Add comments or descriptions to indexes |
| INDEX_COMMENT | text | NO | Index Comment |
| IS_VISIBLE | varchar(3) | NO | Index visibility |
| EXPRESSION | varbinary(262144) | NO | For compatibility with MySQL only. The value is NULL |
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)