<?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>Inside the Optimizer: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx</link><description>For today’s entry, I thought we might take a look at how the optimizer builds an executable plan using rules. To illustrate the process performed by the optimiser, we’ll configure it to produce incrementally better plans by progressively applying the</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Inside the Optimiser: Constructing a Plan</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27377</link><pubDate>Wed, 28 Jul 2010 20:04:38 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27377</guid><dc:creator>Alexander Kuznetsov</dc:creator><description>&lt;p&gt;Welcome aboard, Paul! &lt;/p&gt;
&lt;p&gt;This is a very interesting series. &lt;/p&gt;
&lt;p&gt;Would you mind sharing with us what exactly did you mean by &amp;quot;enabling the SELonJN optimisation rule&amp;quot; and by &amp;quot;Enabling a couple more rules&amp;quot;?&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27382</link><pubDate>Thu, 29 Jul 2010 01:22:26 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27382</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hey, Alex!&lt;/p&gt;
&lt;p&gt;Thanks for the welcome - I'm very excited to be on here, as I've been a big fan of blogs like yours and Adam's for many years.&lt;/p&gt;
&lt;p&gt;The current series of posts is building up to answering the exact question you raise. &amp;nbsp;I promise that all will be revealed very soon :)&lt;/p&gt;
&lt;p&gt;Thanks so much for the feedback.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27383</link><pubDate>Thu, 29 Jul 2010 05:34:30 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27383</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Paul&lt;/p&gt;
&lt;p&gt;Running &amp;nbsp;your query on AW of SQL Server 2005 I got Index Seek on P.ProductNumber LIKE N'T%' and Clustered Index Seek on ProductInventory..&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27385</link><pubDate>Thu, 29 Jul 2010 05:40:26 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27385</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hey Uri,&lt;/p&gt;
&lt;p&gt;Yes you would do - that's the final, fully-optimised, form of the query plan. &amp;nbsp;What I'm trying to show in these series of posts, is how the optimiser incrementally finds improved plans by applying its internal rules.&lt;/p&gt;
&lt;p&gt;I've tweaked the optimiser to restrict the rules available to it at each stage, to better illustrate the iterative nature of the process. &amp;nbsp;Hopefully, things will become clearer as the series progresses ;c)&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>Another Interesting MERGE Bug</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27577</link><pubDate>Tue, 03 Aug 2010 18:06:07 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27577</guid><dc:creator>Page Free Space: Paul White</dc:creator><description>&lt;p&gt;Summary: Investigating an optimiser transformation that exposes a bug in SQL Server’s MERGE implementation.&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27584</link><pubDate>Wed, 04 Aug 2010 01:15:55 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27584</guid><dc:creator>Jay</dc:creator><description>&lt;p&gt;hello:&lt;/p&gt;
&lt;p&gt;Nice article. i ran un-documented DMV &amp;amp; found 377 implementation rules in SQL Sever 2008 Developer Edition SP-1.&lt;/p&gt;
&lt;p&gt;I am curious to know if there is a possible way to see the implementation rules for every execution plan when query or Store Procs is executed in SSMS with Actual Execution Plan&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Jay&lt;/p&gt;</description></item><item><title>Iterators, Query Plans, and Why They Run Backwards</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27613</link><pubDate>Wed, 04 Aug 2010 18:10:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27613</guid><dc:creator>Page Free Space: Paul White</dc:creator><description>&lt;p&gt;Iterators SQL Server uses an extensible architecture for query optimisation and execution, using ‘iterators’&lt;/p&gt;
</description></item><item><title>Page Free Space: Paul White : Inside the Optimiser: Constructing a Plan ??? Part 4</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27758</link><pubDate>Tue, 10 Aug 2010 22:23:53 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27758</guid><dc:creator>Page Free Space: Paul White : Inside the Optimiser: Constructing a Plan ??? Part 4</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sqlblog.com/blogs/paul_white/archive/2010/07/31/inside-the-optimiser-constructing-a-plan-part-4.aspx"&gt;http://sqlblog.com/blogs/paul_white/archive/2010/07/31/inside-the-optimiser-constructing-a-plan-part-4.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Page Free Space: Paul White : Inside the Optimiser: Constructing a Plan ??? Part 3</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27762</link><pubDate>Tue, 10 Aug 2010 22:24:33 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27762</guid><dc:creator>Page Free Space: Paul White : Inside the Optimiser: Constructing a Plan ??? Part 3</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sqlblog.com/blogs/paul_white/archive/2010/07/31/inside-the-optimiser-constructing-a-plan-part-3.aspx"&gt;http://sqlblog.com/blogs/paul_white/archive/2010/07/31/inside-the-optimiser-constructing-a-plan-part-3.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Page Free Space: Paul White : Inside the Optimiser: Constructing a Plan - Part 2</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#27766</link><pubDate>Tue, 10 Aug 2010 22:25:04 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27766</guid><dc:creator>Page Free Space: Paul White : Inside the Optimiser: Constructing a Plan - Part 2</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan-ii.aspx"&gt;http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan-ii.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#28218</link><pubDate>Tue, 24 Aug 2010 00:35:28 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28218</guid><dc:creator>Jeff Moden</dc:creator><description>&lt;p&gt;Awesome series, Paul! &amp;nbsp;Thanks for taking the time to post it.&lt;/p&gt;
&lt;p&gt;--Jeff Moden&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#28219</link><pubDate>Tue, 24 Aug 2010 00:50:43 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28219</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Thank you Jeff - means a lot coming from you.&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#28320</link><pubDate>Thu, 26 Aug 2010 14:41:11 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28320</guid><dc:creator>ColdCoffee</dc:creator><description>&lt;p&gt;Paul, awesome article.. still dint touch other parts, but will definitely spend the night with them.. thanks for sharing...&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#28321</link><pubDate>Thu, 26 Aug 2010 15:01:31 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28321</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hey Cold Coffee (from SSC I presume!)&lt;/p&gt;
&lt;p&gt;Thanks - and do try to make it to the end, because most of the stuff that makes sense is that way...&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#28750</link><pubDate>Tue, 14 Sep 2010 04:26:23 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28750</guid><dc:creator>Chris Leonard</dc:creator><description>&lt;p&gt;This is really interesting. &amp;nbsp;May I (with attribution to you, of course) use some of this information in my PASS Summit presentation? &amp;nbsp;The DMV is part 4 could be useful for showing the impact of certain hints.&lt;/p&gt;
&lt;p&gt;Also, is there a way to get SQL Server to show the logical operation tree it comes up with to begin with? &amp;nbsp;I've heard that older versions of SQL Server would sometimes rewrite queries (replacing left joins with right joins, for example) but I can't find any evidence of this kind of &amp;quot;query normalization&amp;quot; still happening in SQL 2005/2008.&lt;/p&gt;
&lt;p&gt;Thanks again - great series!&lt;/p&gt;
</description></item><item><title>re: Inside the Optimiser: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#28918</link><pubDate>Wed, 22 Sep 2010 22:10:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28918</guid><dc:creator>Paul White</dc:creator><description>&lt;p&gt;Hi Chris,&lt;/p&gt;
&lt;p&gt;Apologies for the slow response. &amp;nbsp;Yes of course that would be fine - in fact I'd be honoured, thank you.&lt;/p&gt;
&lt;p&gt;There's no way to expose the initial algebrized tree I'm afraid. &amp;nbsp;The optimizer sure does consider many plan alternatives, and transforming left and right joins is just one of many tricks it can perform.&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
</description></item><item><title>Heaps of Trouble?</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#31483</link><pubDate>Thu, 09 Dec 2010 17:17:46 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31483</guid><dc:creator>Paul White: Page Free Space</dc:creator><description>&lt;p&gt;If you’re not already a regular reader of Brad Schultz’s blog, you’re missing out on some great material.&amp;amp;#160;&lt;/p&gt;
</description></item><item><title>Paul White: Page Free Space : Inside the Optimizer: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#33807</link><pubDate>Sun, 27 Feb 2011 01:26:32 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:33807</guid><dc:creator>Paul White: Page Free Space : Inside the Optimizer: Constructing a Plan - Part 1</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx"&gt;http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Undocumented Query Plans: The ANY Aggregate</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#36572</link><pubDate>Fri, 01 Jul 2011 14:51:59 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:36572</guid><dc:creator>Paul White: Page Free Space</dc:creator><description>&lt;p&gt;As usual, here’s a sample table: With some sample data: And an index that will be useful shortly: There’s&lt;/p&gt;
</description></item><item><title>re: Inside the Optimizer: Constructing a Plan - Part 1</title><link>http://sqlblog.com/blogs/paul_white/archive/2010/07/29/inside-the-optimiser-constructing-a-plan.aspx#44604</link><pubDate>Tue, 07 Aug 2012 15:11:36 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44604</guid><dc:creator>Adriano Nascimento</dc:creator><description>&lt;p&gt;This is a very Good Series,&lt;/p&gt;
&lt;p&gt;When will you write a book about &amp;quot;Inside the Optimizer&amp;quot;? &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Adriano Nascimento&lt;/p&gt;</description></item></channel></rss>