SELECT max(id) as id FROM t_lesson where status = 1 group by bookId limit 0,20
这条SQL如果删除 status = 1 速度为0.01秒,加上就要好几秒,请问该怎么优化?
SELECT max(id) as id FROM t_lesson where status = 1 group by bookId limit 0,20
这条SQL如果删除 status = 1 速度为0.01秒,加上就要好几秒,请问该怎么优化?
已解决: 给 bookId 和 status 添加联合索引