concept UDF in category sql
appears as: UDF, UDF

This is an excerpt from Manning's book SQL Server MVP Deep Dives Vol. 2.
The problem here is that the UDF prevents direct utilization of index/column statistics. Let’s see what happens when you rewrite the query to allow for direct column access. The following listing shows a refactoring of the original SELECT that places the UDF code inline with the rest of the set-based statement.