We have a system that was written with a few scalar UDF's.
These seem to perform very poorly, in that they get run per-row rather than
set based (which is fine, and if it were up to me i would not use them).
But what i was hoping for is a way to find operations in profiler that have
a high execution count (5000, 10000, 100000) for a single query.
Right now in profiler i include the execution plan with costs, and can go to
each one looking at the execution plan for the number of executes.
There already is "hash warning", "Scan begin", "missing statistics" events.
Perhaps there is "executes warning"?
Ian Boyd - 14 Jul 2008 20:53 GMT
> We have a system that was written with a few scalar UDF's.
>
> These seem to perform very poorly, in that they get run per-row rather
> than set based (which is fine, and if it were up to me i would not use
> them).
Nevermind. These UDF's are running during a "Compute Scalar" operation,
which only ever has one execute.
So even though in profiler i see it executing thousands of times (once for
each row), it's really only executing once.
So there's no way to profile by number of executes.
Andrew J. Kelly - 14 Jul 2008 22:23 GMT
No not directly. You would have to trace to a file and then parse the
results such that you can aggregate them up and get the totals. Have a look
at this: http://www.cleardata.biz/cleartrace/

Signature
Andrew J. Kelly SQL MVP
Solid Quality Mentors
>> We have a system that was written with a few scalar UDF's.
>>
[quoted text clipped - 9 lines]
>
> So there's no way to profile by number of executes.