这句sql能怎么优化,三十多万记录,查询时间要2秒,肯定有问题
SELECT * from (SELECT ROW_NUMBER() over(order by ot.IsEnd asc,ot.AddTime desc) as rownum ,em.Id as emId FROM OngoingTask ot ) t
where t.rownum between 120 and 130
其中IsEnd是int类型,0,1,2,3,代表任务状态,IsEnd与AddTime 都添加了索引。
繁星淼淼
慕田峪9158850
繁华开满天机
子衿沉夜
相关分类