2017年8月10日

sql技巧

摘要: 1、负向条件查询不能使用索引 2、前导模糊查询不能使用索引 3、数据区分度不大的字段不宜使用索引 4、在字段上计算不能命中索引 5、如果业务大部分是单条查询,使用Hash索引性能更好 B-tree索引的时间复杂度是O(log(n)) Hash索引的时间复杂度是O(1) 6、允许为null的列,查询有 阅读全文

posted @ 2017-08-10 17:24 长风剑客 阅读(117) 评论(0) 推荐(1) 编辑

mysql索引案例分析

摘要: 表结构 order (oid,date,uid,status,money,time) oid主键 date 普通索引 uid用户id 普通索引 status 普通索引 select * from order where status != 2 select * from order where st 阅读全文

posted @ 2017-08-10 17:08 长风剑客 阅读(323) 评论(0) 推荐(0) 编辑

导航