XiaoMi / soar

SQL Optimizer And Rewriter
Apache License 2.0
8.67k stars 1.32k forks source link

prefix index length determination #144

Open martianzhang opened 5 years ago

martianzhang commented 5 years ago

Feature Description

As this blog said

"varvhar等字段建立索引长度计算语句:select count(distinct left(test,5))/count(*) from table; 越趋近1越好"

count(distinct left(col, n)) more closed to count(distinct col) will be better.