<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Views or Functions?</title>
	<atom:link href="http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/</link>
	<description>A discussion on SQL Server</description>
	<lastBuildDate>Mon, 30 Jan 2012 12:44:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-110</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Thu, 12 Mar 2009 13:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-110</guid>
		<description>Almost sounds like parameter sniffing. An alter index would force a recompile.

Hard to say much more without seeing it. Are you a member of the SQLServerCentral forums?</description>
		<content:encoded><![CDATA[<p>Almost sounds like parameter sniffing. An alter index would force a recompile.</p>
<p>Hard to say much more without seeing it. Are you a member of the SQLServerCentral forums?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-109</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 12 Mar 2009 13:37:04 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-109</guid>
		<description>We have a situation where we are using a inline table valued function that performs terribly when the server is started. If you &quot;ALTER index ALL&quot; on any of it&#039;s dependent tables then the performance is cut from 30sec down to 2 sec. Would you have any insight for me?</description>
		<content:encoded><![CDATA[<p>We have a situation where we are using a inline table valued function that performs terribly when the server is started. If you &#8220;ALTER index ALL&#8221; on any of it&#8217;s dependent tables then the performance is cut from 30sec down to 2 sec. Would you have any insight for me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-108</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Sat, 20 Sep 2008 08:50:10 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-108</guid>
		<description>I&#039;m not sure. I&#039;ll test it out and see.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure. I&#8217;ll test it out and see.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimbobmcgee</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-107</link>
		<dc:creator>jimbobmcgee</dc:creator>
		<pubDate>Fri, 19 Sep 2008 20:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-107</guid>
		<description>&gt;&gt; I did notice that the optimiser can’t see a join predicate for the join with the UDF, which may have side effects.

Does this mean that, even if a source table is indexed, joining on an inline TVF that only selects from that source table will not use the index?

J.</description>
		<content:encoded><![CDATA[<p>&gt;&gt; I did notice that the optimiser can’t see a join predicate for the join with the UDF, which may have side effects.</p>
<p>Does this mean that, even if a source table is indexed, joining on an inline TVF that only selects from that source table will not use the index?</p>
<p>J.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-106</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Fri, 12 Sep 2008 08:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-106</guid>
		<description>iirc, the elapsed time for the UDF was always slightly higher. I admit, it&#039;s very, very close, and should probably be considered equivalent

Also, if you check the exec plan, SQL considers the UDF to be much more expensive (in my test 10% for the proc, 90% for the UDF), though that&#039;s probably not actually accurate. I did notice that the optimiser can&#039;t see a join predicate for the join with the UDF, which may have side effects.</description>
		<content:encoded><![CDATA[<p>iirc, the elapsed time for the UDF was always slightly higher. I admit, it&#8217;s very, very close, and should probably be considered equivalent</p>
<p>Also, if you check the exec plan, SQL considers the UDF to be much more expensive (in my test 10% for the proc, 90% for the UDF), though that&#8217;s probably not actually accurate. I did notice that the optimiser can&#8217;t see a join predicate for the join with the UDF, which may have side effects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Haines</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-105</link>
		<dc:creator>Adam Haines</dc:creator>
		<pubDate>Thu, 11 Sep 2008 21:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-105</guid>
		<description>Gail,

Why do you say the stored procedure is a more effcient query, if the inline TVF has the same IO and CPU?  Elasped time is not an accurate number for testing performance because it varies from run to run and is influenced by the load your server is undertaking.  CPU is the main thing to look at in statistics TIME because it is a more consistent measure to how much CPU resources were actually used.

I know there is a fine line here between the two, but I would say the SP and the inline TVF are equal.</description>
		<content:encoded><![CDATA[<p>Gail,</p>
<p>Why do you say the stored procedure is a more effcient query, if the inline TVF has the same IO and CPU?  Elasped time is not an accurate number for testing performance because it varies from run to run and is influenced by the load your server is undertaking.  CPU is the main thing to look at in statistics TIME because it is a more consistent measure to how much CPU resources were actually used.</p>
<p>I know there is a fine line here between the two, but I would say the SP and the inline TVF are equal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: More on Table Valued Functions &#171; Home of the Scary DBA</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-104</link>
		<dc:creator>More on Table Valued Functions &#171; Home of the Scary DBA</dc:creator>
		<pubDate>Fri, 15 Aug 2008 11:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-104</guid>
		<description>[...] functions. Gail Shaw is an MVP and a regular at SQL Server Central. She&#8217;s worth tracking and this post shows [...]</description>
		<content:encoded><![CDATA[<p>[...] functions. Gail Shaw is an MVP and a regular at SQL Server Central. She&#8217;s worth tracking and this post shows [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gail</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-103</link>
		<dc:creator>Gail</dc:creator>
		<pubDate>Thu, 14 Aug 2008 16:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-103</guid>
		<description>I don&#039;t recall there been high compile times. That said, I run queries a couple times before taking test times, to prime the cache, and so I wasn&#039;t paying much attention to the times in the first execution.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t recall there been high compile times. That said, I run queries a couple times before taking test times, to prime the cache, and so I wasn&#8217;t paying much attention to the times in the first execution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saggi Neumann</title>
		<link>http://sqlinthewild.co.za/index.php/2008/08/12/views-or-functions/comment-page-1/#comment-102</link>
		<dc:creator>Saggi Neumann</dc:creator>
		<pubDate>Thu, 14 Aug 2008 15:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://sqlinthewild.co.za/?p=112#comment-102</guid>
		<description>Hi Gail,

Interesting post supporting what we usually think&amp;tell the customers.

You left out the parse&amp;compile times on these executions. Were there any differences?

Thanks,
Saggi</description>
		<content:encoded><![CDATA[<p>Hi Gail,</p>
<p>Interesting post supporting what we usually think&amp;tell the customers.</p>
<p>You left out the parse&amp;compile times on these executions. Were there any differences?</p>
<p>Thanks,<br />
Saggi</p>
]]></content:encoded>
	</item>
</channel>
</rss>

