• cengland0 (2/17/2012)


    I immediately thought of using a hint to force the use of the index. Is that wrong somehow?

    SELECT ID,Col

    FROM FirstTable WITH INDEX(IX_Col)

    WHERE Col = @Get;

    Not wrong, just less good. With this hint, I expect you to get an index scan, which could be a bit better than a scan of the clustered index, but still far worse than an index seek.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/