Note
This view is introduced since OceanBase Database V1.4.
Purpose
The information_schema.STATISTICS view records information about table indexes.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(512) | NO | Always has a value of (def). |
| TABLE_SCHEMA | varchar(128) | NO | The name of the database. |
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| NON_UNIQUE | bigint(20) | NO | Whether the index is a unique index. |
| INDEX_SCHEMA | varchar(128) | NO | The name of the database. |
| INDEX_NAME | varchar(256) | NO | The type of the index. |
| SEQ_IN_INDEX | bigint(20) unsigned | NO | The index number. |
| COLUMN_NAME | varchar(128) | NO | The name of the column. |
| COLLATION | varchar(1) | NO | The collation method. |
| CARDINALITY | bigint(0) | NO | The default value is NULL. |
| SUB_PART | bigint(20) | NO | If only part of a column is indexed, the number of characters in the indexed part. If the entire column is indexed, the value is NULL. |
| PACKED | varchar(10) | NO | The default value is NULL. |
| NULLABLE | varchar(3) | NO | Whether the column can contain NULL values. |
| INDEX_TYPE | varchar(16) | NO | The data structure type used by the index. |
| COMMENT | varchar(16) | NO | The comment or description of the index.
NoteStarting from V4.3.1, this field displays the actual index status instead of |
| INDEX_COMMENT | text | NO | The comment of the index. |
| IS_VISIBLE | varchar(3) | NO | Whether the index is visible. |
| EXPRESSION | varbinary(262144) | NO | The value is NULL.
NoteThis field was introduced in V4.2.1. |
Sample query
The following example queries information about table indexes.
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)