原sql:
select ... from T_STUDENT left join T_CLASS on ... where ... order by T_STUDENT.LASTDATE,T_STUDENT.NUMBER
耗时约一分钟
修改后:
select ROW_NUMBER() OVER(ORDER BY T_STUDENT.LASTDATE,T_STUDENT.NUMBER) NUM, ... from T_STUDENT left join T_CLASS on ... where ...
耗时约200ms