SQL语句优化,不考虑索引方面的,只考虑优化这个SQL语句
SELECT u. NAME AS '老师姓名', count(1) AS '讲议数量', ls.lesson_plan_id, ls.student_id, ls.teacher_id, ls.subject_id FROM lesson_plan ls INNER JOIN lesson_plan_quiz lq ON lq.lesson_plan_id = ls.lesson_plan_id -- AND ls.adjust_start_time LIKE '2017-07-13%' -- AND ls.adjust_start_time >= '2017-07-13' -- AND ls.adjust_start_time <= '2017-07-13 23:59:59' -- AND DATE(ls.adjust_start_time) = '2017-07-13' -- and DATEDIFF(ls.adjust_start_time,'2017-07-13')=0 -- AND ls.adjust_start_time BETWEEN '2017-07-13 00:00:00' AND '2017-07-13 23:59:59' AND ls.solve_status = 5 AND ls.lesson_type = 1 AND ls.`status` = 3 AND DATE(ls.adjust_start_time) = '2017-07-13' LEFT JOIN user_info u ON ls.teacher_id = u.user_id GROUP BY u. NAME, ls.lesson_plan_id, ls.student_id, ls.teacher_id, ls.subject_id ORDER BY count(1) DESC
请问优化点有哪些?
AND ls.solve_status = 5 AND ls.lesson_type = 1 AND ls.`status` = 3 AND DATE(ls.adjust_start_time) = '2017-07-13'
这些,我觉得应该是where条件中的