1.set statistics profile on显示文本执行计划
2.select questionid from question with(index= 0 ,nolock)
order by questionid desc
select questionid from question with(index= 0 ,nolock) order by questionid desc
|--Sort(ORDER BY:([IQ].[dbo].[Question].[QuestionID] DESC))
|--Clustered Index Scan(OBJECT:([IQ].[dbo].[Question].[PK_QUESTION]))
3.select questionid from question with(index= 1 ,nolock)
order by questionid desc
select questionid from question with(index= 1 ,nolock) order by questionid desc
|--Clustered Index Scan(OBJECT:([IQ].[dbo].[Question].[PK_QUESTION]), ORDERED BACKWARD)
可以看出index=0执行的是全表扫描,并不把聚集索引当做排序的数据来用