线上问题集锦(2)

mysql and 和 or为什么会导致性能差别巨大?

select t1.* from t_user t1,   t_student_info t2  where t1.user_unique_code = t2.uu_id   
and 
( t1.user_name like '%谭%'  or  t2.student_no like '%谭%'  or  t2.company like '%谭%'  ) 
ORDER BY t1.create_time desc 
select t1.* from t_user t1,   t_student_info t2  where t1.user_unique_code = t2.uu_id   
or 
( t1.user_name like '%谭%'  or  t2.student_no like '%谭%'  or  t2.company like '%谭%'  ) 
ORDER BY t1.create_time desc 

你可能感兴趣的:(java,mysql,java)