0

If I have a query with a condition

where year(MyColumn) = 2009

Since there is no index on MyColumn, will it matter if transform it to be 'sargeable'?

where MyColumn >= '20090101' and MyColumn < '20100101'

(Besides the overhead of the YEAR function call)

4

1 に答える 1

2

index 用にコーディングしてwhere MyColumn >= 20090101 and MyColumn < 20100101ください。将来追加する可能性がありますが、このクエリを使用するように修正するのを忘れてください。

于 2012-05-15T21:10:31.897 に答える