Note
This view is available starting with V1.4.
Purpose
The information_schema.STATISTICS view records the index information of a table.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(512) | NO | Fixed value (def). |
| TABLE_SCHEMA | varchar(128) | NO | The database name. |
| TABLE_NAME | varchar(256) | NO | The table name. |
| NON_UNIQUE | bigint(20) | NO | Indicates whether the index is unique. |
| INDEX_SCHEMA | varchar(128) | NO | The database name. |
| INDEX_NAME | varchar(256) | NO | The index type. |
| SEQ_IN_INDEX | bigint(20) unsigned | NO | The index number. |
| COLUMN_NAME | varchar(128) | NO | The column name. |
| COLLATION | varchar(1) | NO | The comparison method. |
| CARDINALITY | bigint(0) | NO | Default value: 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: NULL. |
| NULLABLE | varchar(3) | NO | Indicates whether the column can be NULL. |
| INDEX_TYPE | varchar(16) | NO | The data structure type used by the index. |
| COMMENT | varchar(16) | NO | The comment or description of the index.
NoteThis column was introduced in V4.3.1. The value of this column is changed from NULL to the actual index status. |
| INDEX_COMMENT | text | NO | The comment of the index. |
| IS_VISIBLE | varchar(3) | NO | Indicates whether the index is visible. |
| EXPRESSION | varbinary(262144) | NO | Reserved for MySQL compatibility. Value: NULL
NoteThis column was introduced in V4.2.1. |
Sample query
Query the index information of a table.
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)
