数据库优化之索引优化 2020/12/3 | 博客 | 评论(0) | 阅读(37) 1.索引优化之选择合适的列进行索引: 1).在where从句、order by从句、group by从句、on从句中出现的列 2).索引字段越小越好 3).离散度大的列放在联合索引的前面,如: SELECT * from payment where customer_id=584 and staff_id=2; 是index(customer_id,staff_id)好?还是index(staff_id,customer_id)...