<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx</link><description>Certain things just don’t go well together! No, not talking about liberals and Republicans. Rather, I’m talking about user defined scalar functions and SQL traces. If you run SQL Trace or SQL Profiler often, you’d find user defined scalar functions to</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#14691</link><pubDate>Mon, 15 Jun 2009 23:46:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14691</guid><dc:creator>Michael K. Campbell</dc:creator><description>&lt;p&gt;Awesome post. &lt;/p&gt;
&lt;p&gt;Very timely too - as I'm almost positive that I'm running into something VERY similar with a client I'm currently helping - where a sproc that repeatedly calls a UDF gobs of times (i.e. more than 50k) seems to take INSANELY longer when it's being OBSERVED. And, your post has helped give me some additional insights to pursue - because I was beginning to suspect very similar issues.&lt;/p&gt;
&lt;p&gt;Great work though, and great post. Loved the intro/anecdote and the details you've provided. &lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#14701</link><pubDate>Tue, 16 Jun 2009 17:22:28 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14701</guid><dc:creator>david wei</dc:creator><description>&lt;p&gt;Linchi, are you using server side trace or client tool (the profiler)? Thanks.&lt;/p&gt;
&lt;p&gt;David.&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#14702</link><pubDate>Tue, 16 Jun 2009 17:52:33 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14702</guid><dc:creator>Linchi Shea</dc:creator><description>&lt;p&gt;Server side SQL trace to a file for the tests described here.&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#14706</link><pubDate>Tue, 16 Jun 2009 20:13:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14706</guid><dc:creator>david wei</dc:creator><description>&lt;p&gt;Thanks, just wondering if any difference if we use Extended Event ...&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#14714</link><pubDate>Wed, 17 Jun 2009 03:15:27 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14714</guid><dc:creator>Mike Walsh</dc:creator><description>&lt;p&gt;Great post, Linchi. Was actually just thinking of doing a &amp;quot;function&amp;quot; post myself with a quick reminder of some of the dangers of even unwatched functions. Sure we all know it but I sure bump into them a lot still..&lt;/p&gt;
&lt;p&gt;Michael --&amp;gt; Linchi's post could explain the issue your client is seeing. It could also just be that the stored procedure is embarrassed.. When you are observing it, it shamefully realizes that the function is not so pretty and the feeling of dejection and shame it experiences when it knows that you are watching is just too much for the poor proc to bear with/&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#15337</link><pubDate>Sun, 19 Jul 2009 14:00:57 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:15337</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I talk about the issues with scalar udfs in the above post. I also mention a way of minimizing the impact of udfs when doing sp and stmt level tracing. Has a dramatic improvement.&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#15951</link><pubDate>Tue, 11 Aug 2009 11:44:17 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:15951</guid><dc:creator>Vish Baliga</dc:creator><description>&lt;p&gt;The --CREATE FUNCTION... &amp;nbsp; also shows up in the DMVs, does that mean we are incurring a hit even without tracing?&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#23454</link><pubDate>Tue, 16 Mar 2010 16:47:22 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:23454</guid><dc:creator>pl80</dc:creator><description>&lt;p&gt;Great post, many thanks! &amp;nbsp;Microsoft explains, that SP:Completed means that a stored procedure completed (who would have thought?) &amp;nbsp;BUT IT ALSO MIGHT MEAN THAT A FUNCTION COMPLETED!!! &amp;nbsp;This is the most important info in this post for me. &amp;nbsp;I run a trace, and included the SP:Completed event. &amp;nbsp;Guess what: &amp;gt; 1 Million trace records in 1 min because a view was using some scalar functions.&lt;/p&gt;
</description></item><item><title>re: Performance impact: SQL trace and user defined scalar functions</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2009/06/15/performance-impact-sql-trace-and-user-defined-scalar-functions.aspx#44198</link><pubDate>Tue, 03 Jul 2012 22:01:31 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44198</guid><dc:creator>Erik Eckhardt</dc:creator><description>&lt;p&gt;Thanks for posting the results of your learning so we all could learn, too. Some valuable stuff here.&lt;/p&gt;
</description></item></channel></rss>