Note
This view is introduced since OceanBase Database V1.4.
Purpose
The information_schema.STATISTICS view displays information about table indexes.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(512) | NO | The catalog. The value of this column is always 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 | Indicates whether the index is unique. |
| INDEX_SCHEMA | varchar(128) | NO | The name of the database. |
| INDEX_NAME | varchar(256) | NO | The type of index. |
| SEQ_IN_INDEX | bigint(20) unsigned | NO | The sequence number of the index. |
| COLUMN_NAME | varchar(128) | NO | The name of the column. |
| COLLATION | varchar(1) | NO | The name of the collation. |
| CARDINALITY | bigint(0) | NO | The estimated number of unique values in the index. |
| SUB_PART | bigint(20) | NO | The index prefix, which is the number of indexed characters if the column is only partly indexed. The value is NULL if the entire column is indexed. |
| PACKED | varchar(10) | NO | Indicates how the key is packed. |
| NULLABLE | varchar(3) | NO | Indicates 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.
NoteThis value of this column is changed from |
| INDEX_COMMENT | text | NO | The index comment. |
| IS_VISIBLE | varchar(3) | NO | Indicates whether the index is visible. |
| EXPRESSION | varbinary(262144) | NO | The storage expression. |
Sample query
Query 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)