摘要: 这里是一个工具,即pt-duplicate-key-checker工具 用来检查重复及冗余的索引 用法如下:pt-duplicate-key-checker -uroot -p密码 -h127.0.0.1 数据库结构优化: 那么为什么需要使用not null 定义字段呢? 因为innodb引擎的数据 阅读全文
posted @ 2018-07-10 20:55 水滴月 阅读(1286) 评论(0) 推荐(0) 编辑
摘要: 1. 在where 从句,group by 从句,order by 从句,on 从句中出现的列; 2. 索引字段越小越好; 3. 离散度大的列放到联合索引的前面;比如: select * from payment where staff_id = 2 and customer_id = 236; 针 阅读全文
posted @ 2018-07-10 20:21 水滴月 阅读(1319) 评论(0) 推荐(0) 编辑