mysql.table_stats Table

The mysql.table_stats table is one of three tables storing data used for Engine-independent table statistics. The others are mysql.column_stats and mysql.index_stats.

It is populated when the ANALYZE TABLE statement is run, although not by default. See Collecting Statistics with the ANALYZE TABLE Statement for details.

It is possible to manually update the table and, unlike most system tables, there are some scenarios where this could be useful. See Manual updates to statistics tables for details.

This table uses the Aria storage engine.

The mysql.table_stats table contains the following fields:

Field
Type
Null
Key
Default
Description

Field

Type

Null

Key

Default

Description

db_name

varchar(64)

NO

PRI

NULL

Database the table is in .

table_name

varchar(64)

NO

PRI

NULL

Table name.

cardinality

bigint(21) unsigned

YES

NULL

Number of records in the table.

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?