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 | 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 name 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 | The number of characters that are indexed if only part of a column is indexed. If the entire column is indexed, the value is NULL. |
| PACKED | varchar(10) | NO | The default value is NULL. |
| NULLABLE | varchar(3) | NO | 1 if the column can contain NULL values; 0 otherwise. |
| INDEX_TYPE | varchar(16) | NO | The data structure used by the index. |
| COMMENT | varchar(16) | NO | The comment or description added to the index.
NoteThis field has a value of |
| INDEX_COMMENT | text | NO | The comment added to the index. |
| IS_VISIBLE | varchar(3) | NO | 1 if the index is visible; 0 otherwise. |
| 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)