SQL Server 2008: Ordering by datetime is too slow

前端 未结 7 1939
鱼传尺愫
鱼传尺愫 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条回答
  •  -上瘾入骨i
    2020-12-14 02:30

    maybe if you store datatime as a int but it would take time converting each time you store or get data. (common technique used to store staff like ip address and have a faster seek times)

    you should check in your server how it stores datetime, b/c it your server already stores it as int or bigint.. it will not change anything....

提交回复
热议问题