-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support MySQL index optimize #55
Comments
需要考虑ce/ee功能区分 |
功能交互新增全局配置规则 ConfigIndexOptimizerEnabled,启用该规则表明会对 select 语句开启索引优化建议流程。该规则的 value 设计为 json 格式,支持的配置为:
当用户启用规则 ConfigIndexOptimizerEnabled 后,在工单页面在输入 select 语句,点击审核,在「审核结果」中会给出审核结果等级为 notice 的索引建议。 索引建议支持场景:等值查询SQL:select * from t1 where c1 = '1'; SQL:select * from t1 where c1 = '1' and c2 = '2' and c3 > '3'; selectivity(c2) > selectivity(c1) SQL:select c1,c2,c3 from t1 where c1 = '1'; selectivity(c3) > selectivity(c2) 模糊查询SQL:select * from t1 where c1 like 'abcdef%'; 关联查询SQL:select * from t1, t2 where t1.c1 = t2.c1; rows(t1) > rows(t2) 函数查询SQL:select * from t1 where date(c1) = '2100-02-02'; SQL:select * from t1 where date(c1) = '2100-02-02'; SQL:select Min(c1) from t1; 考虑
|
整体目标是将不同类型数据库公用的逻辑抽离出来,形成 three-star index 算法。在此基础上针对不同的数据库有自己 case-by-case 的逻辑。
对数据库下发的 SQL:
|
sub-task tracking:
The text was updated successfully, but these errors were encountered: