← Back to team overview

maria-discuss team mailing list archive

mariadb still uses indexes with high average value group size.


I was playing around with indexes after we faced problems with mariadb choosing the wrong index because of high average value group size.

So I created a table with 4 text columns and indexed the 4th column with a prefix length of 1.

Following are the stats in brief --

The index has 35 unique values
There are around 1040000 rows in total.
this will give an average value group size of 29714
Cardinality is calculated as <no. of records in the index>/<average size of value groups>, thus it's value must be 35

BUT from show indexes, it's value is shown as 72 (innodb_stats_persistent_sample_pages = 9999999).

Follow ups