# Information Schema STATISTICS Table

The [Information Schema](https://mariadb.com/docs/server/reference/system-tables/information-schema) `STATISTICS` table provides information about table indexes.

It contains the following columns:

| Column          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TABLE\_CATALOG  | Always def.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| TABLE\_SCHEMA   | Database name.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| TABLE\_NAME     | Table name.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| NON\_UNIQUE     | 1 if the index can have duplicates, 0 if not.                                                                                                                                                                                                                                                                                                                                                                                                |
| INDEX\_SCHEMA   | Database name.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| INDEX\_NAME     | Index name. The primary key is always named PRIMARY.                                                                                                                                                                                                                                                                                                                                                                                         |
| SEQ\_IN\_INDEX  | The column sequence number, starting at 1.                                                                                                                                                                                                                                                                                                                                                                                                   |
| COLUMN\_NAME    | Column name.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| COLLATION       | A for sorted in ascending order, or NULL for unsorted.                                                                                                                                                                                                                                                                                                                                                                                       |
| CARDINALITY     | Estimate of the number of unique values stored in the index based on statistics stored as integers. Higher cardinalities usually mean a greater chance of the index being used in a join. Updated by the [ANALYZE TABLE](https://mariadb.com/docs/server/reference/sql-statements/table-statements/analyze-table) statement or [myisamchk -a](https://mariadb.com/docs/server/clients-and-utilities/myisam-clients-and-utilities/myisamchk). |
| SUB\_PART       | NULL if the whole column is indexed, or the number of indexed characters if partly indexed.                                                                                                                                                                                                                                                                                                                                                  |
| PACKED          | NULL if not packed, otherwise how the index is packed.                                                                                                                                                                                                                                                                                                                                                                                       |
| NULLABLE        | YES if the column may contain NULLs, empty string if not.                                                                                                                                                                                                                                                                                                                                                                                    |
| INDEX\_TYPE     | Index type, one of BTREE, RTREE, HASH or FULLTEXT. See [Storage Engine Index Types](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/storage-engine-index-types).                                                                                                                                                                                                                         |
| COMMENT         | Index comments from the [CREATE INDEX](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-index) statement.                                                                                                                                                                                                                                                                                              |
| IGNORED         | Whether or not an index will be ignored by the optimizer. See [Ignored Indexes](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/optimization-and-indexes/ignored-indexes). From [MariaDB 10.6.0](https://app.gitbook.com/s/aEnK0ZXmUbJzqQrTjFyb/community-server/10.6/10.6.0).                                                                                                                                    |
| CREATE\_OPTIONS | Extra [CREATE TABLE](https://mariadb.com/docs/server/server-usage/tables/create-table) options.This column is available from MariaDB 13.0.                                                                                                                                                                                                                                                                                                   |

The [SHOW INDEX](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-index) statement produces similar output.

## Example

```sql
SELECT * FROM INFORMATION_SCHEMA.STATISTICS\G
...
*************************** 85. row ***************************
TABLE_CATALOG: def
 TABLE_SCHEMA: test
   TABLE_NAME: table1
   NON_UNIQUE: 1
 INDEX_SCHEMA: test
   INDEX_NAME: col2
 SEQ_IN_INDEX: 1
  COLUMN_NAME: col2
    COLLATION: A
  CARDINALITY: 6
     SUB_PART: NULL
       PACKED: NULL
     NULLABLE: 
   INDEX_TYPE: BTREE
      COMMENT: 
INDEX_COMMENT:
...
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
