SQL优化手册 1、in vs or 对索引字段或非索引字段单个值操作时,两者无异;但是对非索引字段多个值操作,相比in,or效率会随着值的个数增加效率相对下滑 2、group by vs distinct 案例:select count() from (select name from student group by name )student_temp 这个sql作用是统计学生表不重复姓名的总数 优化方案1:select count(distinct name) from student 优化方案2:select count() from (select distinct name fr