SQL Server 2008: Ordering by datetime is too slow

前端 未结 7 1916
鱼传尺愫
鱼传尺愫 2020-12-14 01:56

My table (SQL Server 2008) has 1 million+ records, when I try to order records by datetime, it takes 1 second, but when I order by ID (int), it only takes about 0.1 second.<

相关标签:
7条回答
  • 2020-12-14 02:47

    Could it be that there is an index for your int column but not for your datetime column? Look at the execution plan.

    0 讨论(0)
提交回复
热议问题