April 26, 2007 at 4:45 am
Hi everyone,
Can anyone explain to me how using Funtion in WHERE clause of the SQL QUERISE effect the serever performance?
The data server is very very large with loads and loads of record.
Thanks
Sree
April 27, 2007 at 5:00 pm
Depending on how and where the function is used in a WHERE clause, it can drastically and negatively affect performance because it may disable the ability for INDEX SEEKs to occur. And, it doesn't matter if it's a UDF or a system function... although UDF's are typically poorly written and may be a performance problem all by them selves...
--Jeff Moden
Change is inevitable... Change for the better is not.
April 28, 2007 at 9:39 am
depends if the function is based on a datacolumn (needs calculation per record) or if the function is based on a condition (calculated once, calculated value is than a candidate for indexuse)
April 30, 2007 at 6:44 am
The other thing is, the function which runs against every row in a query amounts to row by row processing, something that could only be accomplished with a while loop or a cursor in the past.
And we all know to avoid those whenever we can, ideally almost always.
P
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply