October 11, 2012 at 7:04 am
which is better for performance wise,
function or join?
thanks
October 11, 2012 at 8:14 am
That's a pretty broad question, so a "it depends" is probably appropriate. But a user defined function has to execute on each individual row. I'd go with the JOIN (especially assuming good indexing) as being the better way to go.
HTH,
Rob
October 11, 2012 at 8:21 am
Dhirju (10/11/2012)
which is better for performance wise,function or join?
thanks
An inline table-valued function can perform equally as well as a join to tables. If the function has BEGIN/END in it, then performance will lag behind a join.
Paul White discusses iTVF's in his papers, links in my sig. Rob Farley's amusing blog discusses the performance of the different types of SQL Server functions.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 11, 2012 at 8:27 am
Dhirju (10/11/2012)
which is better for performance wise,function or join?
thanks
What is the healthier Apples or Oranges? 😉
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply