Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Execution plans for queries involving functions...

Author  Topic 

aiken
Aged Yak Warrior

525 Posts

Posted - 2002-01-22 : 16:37:55
Am I correct in thinking that there's no way to see the impact that user defined functions have when looking at execution plans?

I'm trying to opitimize a fairly complex query that calls a couple of user defined functions. No matter what I do to those functions, even intentionally screwing them up, the overall query cost remains the same.

I can see them hit in the server trace, but the granularity of timing is so low that they are almost always 0ms or 16ms, and I really don't want to manually add the 100,000 instances or so to come up with a total duration for each function.

I know that I can explode the functions' source code and incorporate them into the main query, and then optimize that, and then put those optimizations back into the original functions, but it seems like too much work, and like it would be pretty error-prone.

Any thoughts on this?

Thanks
-b

royv
Constraint Violating Yak Guru

455 Posts

Posted - 2002-01-22 : 16:47:48
It might be a pain in the butt, but you could take the code from the udf and run it by itself and see what the query plan is.

*************************
Just trying to get things done
Go to Top of Page
   

- Advertisement -