SQL Server Optimizer Hints

What if a hint you specify is not used? Just because you add a hint to a query, it doesn’t mean that SQL Server will use it. For example, if you add a hint that a specific index should be used in a query, but the Query Optimizer doesn’t need to access the table because it found a relevant Indexed View to use instead, the hint will be ignored.

In another case, locking hints are ignored in cases where the “hinted” column includes computed columns and these columns are computed by functions or expressions accessing columns in other tables.

In most cases, if you notice that a hint you have specified is not used, it is most likely because is not appropriate (you made a mistake). So if a hint is not used, check your hint to see if it is appropriate. [7.0, 2000, 2005] Updated 5-1-2006

Pages: 1 2


No comments yet... Be the first to leave a reply!