mysql.column_stats Table
The mysql.column_stats
table is one of three tables storing data used for Engine-independent table statistics. The others are mysql.table_stats and mysql.index_stats.
Note that statistics for blob and text columns are not collected. If explicitly specified, a warning is returned.
MariaDB starting with 10.4
In MariaDB 10.4 and later, this table uses the Aria storage engine.
MariaDB until 10.3
In MariaDB 10.3 and before, this table uses the MyISAM storage engine.
The mysql.column_stats
table contains the following fields:
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. |
column_name | varchar(64) | NO | PRI | NULL | Name of the column. |
min_value | varchar(255) | YES | NULL | Minimum value in the table (in text form). | |
max_value | varchar(255) | YES | NULL | Maximum value in the table (in text form). | |
nulls_ratio | decimal(12,4) | YES | NULL | Fraction of NULL values (0- no NULL s, 0.5 - half values are NULL s, 1 - all values are NULL s). | |
avg_length | decimal(12,4) | YES | NULL | Average length of column value, in bytes. Counted as if one ran SELECT AVG(LENGTH(col)) . This doesn't count NULL bytes, assumes endspace removal for CHAR(n) , etc. | |
avg_frequency | decimal(12,4) | YES | NULL | Average number of records with the same value | |
hist_size | tinyint(3) unsigned | YES | NULL | Histogram size in bytes, from 0-255, or, from MariaDB 10.7, number of buckets if the histogram type is JSON_HB . | |
hist_type | enum('SINGLE_PREC_HB', 'DOUBLE_PREC_HB') (>= MariaDB 10.7)enum('SINGLE_PREC_HB', 'DOUBLE_PREC_HB','JSON_HB') (<= MariaDB 10.6) | YES | NULL | Histogram type. See the histogram_type system variable. | |
histogram | blob (>= MariaDB 10.7)varbinary(255) (<=MariaDB 10.6) | YES | NULL |
It is possible to manually update the table. See Manual updates to statistics tables for details.
Comments
Comments loading...
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.