Possible Duplicate:
Why does the Execution Plan include a user-defined function call for a computed column that is persisted?
I've added a persisted computed column to a table.
ALTER TABLE guest
ADD FullName AS
dbo.complicatedFunction(ISNULL(FirstName, N'') + ISNULL(LastName, '')) PERSISTED
GO
I also added a non-clustered index on that field.
When I do a select from that table and include the column into a where statement it takes very long to execute.
I tried replacing the persisted column with the expression directly and it takes the same amount of time to execute, which led me to believe that FullName field is being recalculated for every row when I try to select something from that table.
How can I avoid that recalculation and get the query to use the index?