• Using columns in functions means SQL Server can no longer do a seek; instead it must do a scan.

    If there was a unique index on CustomerID, orddate.

    Say you had 1 million rows per year between 2000 and 2007 for customerid = 1234

    Say you wanted the counts for customerid 1234 for year 2007

    Using the function Year( orddate ) = 2007 means that all the rows from 2000 for that customerid in the index need to be searched because SQL Server does not know the result until it has read the data and performed the function on the column.

    Using >= '20070101' and < '20080101' allows SQL Server to just seek straight to the start 20070101 and read from there.