摘要:
前缀索引 创建前缀索引 alter table t add index idx_email(email); alter table t add index idx_email(email(6)); 使用前缀索引,定义好长度,可以做到即节省空间,又不用额外增加太多查询成本。 区分度 建立索引时,区分度 阅读全文
摘要:
查询语句执行性能 explain 查看优化器选择的索引 explain select * from t where a between 10000 and 20000 慢日志查询语句执行时间和扫描行数 set long_query_time=0; select * from t where a be 阅读全文