Performance issue with Join on Computed Column
-
Monday, January 21, 2013 5:57 PM
When joining with Persisted Computed Column I see performance degradation. For testing purpose I created another column in the table with same value that is in the Computed Column and the result comes very fast when I join against this new column. In the Execution Plan I see the Number Of execution is same as the number of records being returned when I am joining against this Computed Column which is very high.
The expression for Computed Column is :
[Id]
AS (([Code]+'_')+CONVERT([varchar](10),[MiddletierId],(0))) PERSISTED NOT NULL,
What is the reason behind this performance degradation ?
Thanks!!
All Replies
-
Monday, January 21, 2013 6:47 PMModerator
Do you have index on the computed column?
Optimization article:
http://www.sqlusa.com/articles/query-optimization/
Kalman Toth SQL 2008 GRAND SLAM
Paperback: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012 -
Monday, January 21, 2013 7:16 PM
Yes it has index on it.
-
Monday, January 21, 2013 8:47 PMModerator
Index recently rebuilt? Statistics up-to-date?
What do you see in the execution plan? Can you post some script so we can test? Thanks.
Kalman Toth SQL 2008 GRAND SLAM
Paperback: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012
- Edited by Kalman TothMicrosoft Community Contributor, Moderator Monday, January 21, 2013 9:36 PM

