写了一个分页的sql语句,第一次执行的效率很慢,SELECT poco_base.*
FROM (
SELECT ROW_NUMBER() OVER(ORDER BY Exam_RowID asc) AS RowID,
Exam_ID AS ExamID,Exam_Difficulty AS Difficulty,
Exam_StuUsedCount AS StudentUsedCount,
Exam_QuestionTypeID AS QuestionTypeID,
Exam_QuestionTypeName AS QuestionTypeName,
Exam_ErrorCount AS ErrorCount
FROM dbo.T_ExamSync
WHERE (Exam_State=1)) poco_base WHERE poco_base.RowID>0 AND poco_base.RowID<=10
表里面数据也就十来万,Exam_RowId是主键自增长,Exam_ID是唯一索引
FROM (
SELECT ROW_NUMBER() OVER(ORDER BY Exam_RowID asc) AS RowID,
Exam_ID AS ExamID,Exam_Difficulty AS Difficulty,
Exam_StuUsedCount AS StudentUsedCount,
Exam_QuestionTypeID AS QuestionTypeID,
Exam_QuestionTypeName AS QuestionTypeName,
Exam_ErrorCount AS ErrorCount
FROM dbo.T_ExamSync
WHERE (Exam_State=1)) poco_base WHERE poco_base.RowID>0 AND poco_base.RowID<=10
表里面数据也就十来万,Exam_RowId是主键自增长,Exam_ID是唯一索引
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货