This is a read-only copy of the MariaDB Knowledgebase generated on 2025-03-04. For the latest, interactive version please visit https://mariadb.com/kb/.

mysql.index_stats Table

The mysql.index_stats table is one of three tables storing data used for Engine-independent table statistics. The others are mysql.column_stats and mysql.table_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.index_stats table contains the following fields:

FieldTypeNullKeyDefaultDescription
db_namevarchar(64)NOPRINULLDatabase the table is in.
table_namevarchar(64)NOPRINULLTable name
index_namevarchar(64)NOPRINULLName of the index
prefix_arityint(11) unsignedNOPRINULLIndex prefix length. 1 for the first keypart, 2 for the first two, and so on. InnoDB's extended keys are supported.
avg_frequencydecimal(12,4)YESNULLAverage number of records one will find for given values of (keypart1, keypart2, ..), provided the values will be found in the table.

It is possible to manually update the table. See Manual updates to statistics tables for details.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.