<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>SQL Optimizations - Manual Update statistics on small tables may provide a big impact.</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx</link><description>Problem: When I analyzed a performance problem in an ISV data warehouse solution running on SQL Server 2000 I figured out that the query plan of a star join (join between a huge fact table and a bunch of small dimension tables) didn't look right. Further</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Interesting Finds</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#596259</link><pubDate>Fri, 12 May 2006 19:44:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:596259</guid><dc:creator>Jason Haley</dc:creator><description /></item><item><title>Manual Update statistics on small tables may provide a big impact</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#596433</link><pubDate>Fri, 12 May 2006 23:24:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:596433</guid><dc:creator>I want some Moore!</dc:creator><description /></item><item><title>re: SQL Optimizations - Manual Update statistics on small tables may provide a big impact.</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#3886179</link><pubDate>Mon, 16 Jul 2007 03:46:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3886179</guid><dc:creator>Peter K</dc:creator><description>&lt;p&gt;I have a case in a star schema where the fact has many small dimensions around it and a handful of large dimensions.&lt;/p&gt;
&lt;p&gt;The small dimenions typically have between 10 and 100 rows in them.&lt;/p&gt;
&lt;p&gt;When the fact is joined out to all the dimensions, the optimizer halves its estimate of the size of the result set each time it joins to one of the small dimensions.&lt;/p&gt;
&lt;p&gt;If the initial result set is say 100k rows, the estimate drops to 50K after the join to the first small dimension, 25k after the second, 12k after the third... roughly speaking.&lt;/p&gt;
&lt;p&gt;Once the estimate of the result set gets to about 10k rows, the joins switch from hash joins to nested loop joins.&lt;/p&gt;
&lt;p&gt;Net result is lots of nested loop joins occurring on results sets that are 100k and bigger.&lt;/p&gt;
&lt;p&gt;The stats have been updated manually &amp;nbsp; &amp;nbsp; &amp;nbsp;update statistics &amp;lt;tablename&amp;gt; with fullscan&lt;/p&gt;
&lt;p&gt;Once a bit of noise is added to the dimensions the optimizer starts to get estimates of the result set correct.&lt;/p&gt;
&lt;p&gt;About 1,000 rows seems to do the trick. &lt;/p&gt;
&lt;p&gt;Is there a simple way to get the optimizer making the correct estimates of the size of the result set on these joins to the small dimensions&lt;/p&gt;
</description></item><item><title> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | unemployment office</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#9759808</link><pubDate>Tue, 16 Jun 2009 11:02:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9759808</guid><dc:creator> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | unemployment office</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://unemploymentofficeresource.info/story.php?id=15610"&gt;http://unemploymentofficeresource.info/story.php?id=15610&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | patio set</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#9771581</link><pubDate>Thu, 18 Jun 2009 05:01:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9771581</guid><dc:creator> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | patio set</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://patiosetsite.info/story.php?id=981"&gt;http://patiosetsite.info/story.php?id=981&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | adirondack chairs</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#9783916</link><pubDate>Fri, 19 Jun 2009 12:28:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9783916</guid><dc:creator> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | adirondack chairs</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://adirondackchairshub.info/story.php?id=3773"&gt;http://adirondackchairshub.info/story.php?id=3773&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | debt solutions</title><link>http://blogs.msdn.com/mssqlisv/archive/2006/05/11/595723.aspx#9790417</link><pubDate>Fri, 19 Jun 2009 19:43:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9790417</guid><dc:creator> Microsoft SQL ISV Program Management Team SQL Optimizations Manual | debt solutions</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://debtsolutionsnow.info/story.php?id=6802"&gt;http://debtsolutionsnow.info/story.php?id=6802&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>