Mysql 列上的索引的基数低于非重复计数?

Index on Mysql column has lower cardinality than count distinct?

我有一个名为 token 的 varchar(50) 字段。当我做

count(distinct token) from table 

我得到 ~ 400k。但是,如果我这样做

create index idx on table (token)

基数只有 200。这是怎么回事?基数不应该与不同标记的数量相同吗?

基数是索引中唯一值数量的估计值。根据 documentation:

Cardinality is counted based on statistics stored as integers, so the value is not necessarily exact even for small tables.