<?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>Tips, Tricks, and Advice from the SQL Server Query Processing Team : Statistics Profile</title><link>http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Statistics+Profile/default.aspx</link><description>Tags: Statistics Profile</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Store Statistics XML in database tables using SQL Traces for further analysis.</title><link>http://blogs.msdn.com/sqlqueryprocessing/archive/2007/06/01/store-statistics-xml-in-database-tables-using-sql-traces-for-further-analysis.aspx</link><pubDate>Fri, 01 Jun 2007 19:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3027552</guid><dc:creator>queryproc</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/sqlqueryprocessing/comments/3027552.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlqueryprocessing/commentrss.aspx?PostID=3027552</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Since SQL&amp;nbsp;Server 2005, &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms187757.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms187757.aspx"&gt;query plan&lt;/A&gt; as well as &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms176107.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms176107.aspx"&gt;statistics&lt;/A&gt; of query execution can be&amp;nbsp;captured &amp;nbsp;in XML format. Also, SQL Server 2005 has &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms189075.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms189075.aspx"&gt;XQuery&lt;/A&gt; support to directly query XML document. By combining these two new features, users can&amp;nbsp;analyze the query plans using queries. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;However, in SQL Server, there is no easy way to capture the statitics XML into a table. Fortunately, there are &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms191443.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms191443.aspx"&gt;SQL traces&lt;/A&gt; provided by SQL Server to capture the showplan XML and statistics XML information into trace files and loaded into tables.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT face=Calibri size=3&gt;Note: The only limitation is the &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms345110(SQL.90).aspx#sql_2k5xmlopt_topic6" mce_href="http://msdn2.microsoft.com/en-us/library/ms345110(SQL.90).aspx#sql_2k5xmlopt_topic6"&gt;128 level&lt;/A&gt; of nesting levels supported by &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms189887(SQL.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms189887(SQL.90).aspx"&gt;XML data type&lt;/A&gt; in&amp;nbsp;SQL 2005.&lt;/FONT&gt;&amp;nbsp;In that case, you have to write client code to parse the query plan, which going to be a very complex query plan.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Here is a small example using &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms191443.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms191443.aspx"&gt;SQL traces&lt;/A&gt; to store the &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms176107.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms176107.aspx"&gt;statistics XML&lt;/A&gt; and extract the &lt;A class="" href="http://blogs.msdn.com/queryoptteam/archive/2006/08/29/730521.aspx" mce_href="http://blogs.msdn.com/queryoptteam/archive/2006/08/29/730521.aspx"&gt;estimated rows and actual rows&lt;/A&gt;.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;/*Using Traces to Capture Statistics XML*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; @trace_id &lt;SPAN style="COLOR: blue"&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; @trace_file &lt;SPAN style="COLOR: blue"&gt;nvarchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;200&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; @trace_file &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'c:\temp\test_stats_'&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;cast&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;newid&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;()&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;varchar&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;100&lt;SPAN style="COLOR: gray"&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- using trace table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;exec&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms190362.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms190362.aspx"&gt;sp_trace_create&lt;/A&gt; @trace_id &lt;SPAN style="COLOR: blue"&gt;output&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @tracefile&lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt;@trace_file&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- capture statistics-xml, textdata, on&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;exec&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms186265.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms186265.aspx"&gt;sp_trace_setevent&lt;/A&gt; @trace_id&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; 146&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; 1&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- start&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;exec&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms176034.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms176034.aspx"&gt;sp_trace_setstatus&lt;/A&gt; @trace_id&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- test statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: gray"&gt;*&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt; &lt;SPAN style="COLOR: green"&gt;sys.objects&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- stop&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;exec&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; sp_trace_setstatus @trace_id&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- close&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;exec&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; sp_trace_setstatus @trace_id&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; 2&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- load trace files into table&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;object_id&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'temp_trc'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;is&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;not&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;drop&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;table&lt;/SPAN&gt; temp_trc&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: gray"&gt;*&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;into&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; temp_trc&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;from&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: fuchsia"&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/ms188425.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms188425.aspx"&gt;fn_trace_gettable&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;@trace_file &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'.trc'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;default&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- look at the captured stats xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; @plan &lt;SPAN style="COLOR: blue"&gt;xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; @plan&lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: fuchsia"&gt;cast&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;textdata &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;xml&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;from&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; temp_trc&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;where&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; eventclass &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 146&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'"&gt;-- collect the actual and also estimate stats.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;with&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: blue"&gt;XMLNAMESPACES&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'http://schemas.microsoft.com/sqlserver/2004/07/showplan'&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;sql&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@NodeId'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'int'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; NodeId&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@PhysicalOp'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'nvarchar(200)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; PhysicalOp&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@LogicalOp'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'nvarchar(200)'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; LogicalOp&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@EstimateRows'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'float'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;*&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@EstimateRewinds'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'float'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt;&amp;nbsp; ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@EstimateRebinds'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'float'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;+&lt;/SPAN&gt; 1.0&lt;SPAN style="COLOR: gray"&gt;))&lt;/SPAN&gt; EstimateRows&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;case&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;when&lt;/SPAN&gt; root_actual&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;ActualRows &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;then&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;null&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;else&lt;/SPAN&gt; root_actual&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;ActualRows &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;end&lt;/SPAN&gt; ActualRows&lt;SPAN style="COLOR: gray"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: fuchsia"&gt;cast&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;exist&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'*/sql:RelOp'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bit&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; IsNotLeaf&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;from&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; @plan&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;nodes&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'//sql:RelOp'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; ro&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;cross&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;apply&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;rti&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;info&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;value&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'@ActualRows'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'float'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;))&lt;/SPAN&gt; ActualRows&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt; ro&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;relop&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;nodes&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;'sql:RunTimeInformation/sql:RunTimeCountersPerThread'&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; rti&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;info&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;)&lt;/SPAN&gt; root_actual&lt;SPAN style="COLOR: gray"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;go&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri"&gt;&lt;FONT face=Calibri&gt;The output of the estimate rows and actual rows is given below:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;
&lt;TABLE class=MsoTableLightGridAccent1 style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: auto auto auto -0.3pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-alt: solid #4F81BD 1.0pt; mso-border-themecolor: accent1" cellSpacing=0 cellPadding=0 border=1 class="MsoTableLightGridAccent1"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: -1; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 2.25pt solid; BACKGROUND-COLOR: transparent; mso-border-themecolor: accent1; mso-border-bottom-themecolor: accent1" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 5"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;NodeId&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 2.25pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 1"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;PhysicalOp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 2.25pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 1"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;LogicalOp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 2.25pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 1"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;EstimateRows&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 2.25pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 1"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;ActualRows&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #4f81bd 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 2.25pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 1"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;IsNotLeaf&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 0"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 68"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Nested Loops&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Left Outer Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 132"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Nested Loops&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Left Outer Join&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 68"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 132"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Compute Scalar&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Compute Scalar&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 68"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Clustered Index Scan&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Clustered Index Scan&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 5"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 132"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;13&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Clustered Index Seek&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Clustered Index Seek&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52.000031&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; BACKGROUND-COLOR: transparent; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 128"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 6; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #4f81bd 1pt solid; WIDTH: 48pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=80&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 68"&gt;&lt;B&gt;&lt;SPAN style="FONT-FAMILY: 'Cambria','serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-fareast-theme-font: major-fareast; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-bidi-theme-font: major-bidi"&gt;&lt;FONT size=3&gt;14&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Clustered Index Seek&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 101.1pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=169&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Clustered Index Seek&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 81.75pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=136&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;52&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: #4f81bd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #f0f0f0; PADDING-LEFT: 5.4pt; BACKGROUND: #d3dfee; PADDING-BOTTOM: 0in; BORDER-LEFT: #f0f0f0; WIDTH: 79.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-border-top-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63" vAlign=top width=133&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-yfti-cnfc: 64"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3027552" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Statistics+XML/default.aspx">Statistics XML</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Statistics+Profile/default.aspx">Statistics Profile</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/SQL+Server+2005/default.aspx">SQL Server 2005</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Tracing/default.aspx">Tracing</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/SQL+Trace/default.aspx">SQL Trace</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Estimate+Rows/default.aspx">Estimate Rows</category></item><item><title>Statistics Profile Output Formatting</title><link>http://blogs.msdn.com/sqlqueryprocessing/archive/2006/10/20/statistics-profile-output-formatting.aspx</link><pubDate>Fri, 20 Oct 2006 23:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:851398</guid><dc:creator>queryproc</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/sqlqueryprocessing/comments/851398.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlqueryprocessing/commentrss.aspx?PostID=851398</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Statistics profile output is an important tool when it comes to troubleshooting query plan issues. When enabled, it returns a textual representation of the query plan with a lot of detail about cost and cardinality estimates as well as actual counts. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;When working in SQL Server management Studio (SSMS), it is advised to enable grid mode to output the results of statistics profile. This presents the results in a neatly formatted way. It also allows to easily copy and past the result in Excel for further manipulation (hiding columns, highlighting individual cells, adding columns with additional calculations, …). But what if grid output mode is not available? E.g., when running SQL Trace with an event to produce statistics profile output for each query, the result is always presented as flat text. For even mildly complex queries this output is hard to decipher.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;The attached perl script helps to solve this formatting problem. It takes the flat text output of statistics profile and parses it to identify individual columns. It then generates tab delimited output which can be directly consumed by Excel.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Usage is straightforward: the script assumes one individual statistics profile in a regular text file (ANSI text only please, UNICODE output confuses the script). Just run&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;FONT size=3&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;perl statspro.pl &amp;lt;input file&amp;gt; &amp;lt;output file&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;E.g., lets assume I have my statistics profile output in a file called test.txt I’ll run&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;perl statspro.pl test.txt test.xls&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;The resulting xls file can be directly viewed with Excel.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Note that I’m not a perl wizard and there might be a more elegant/efficient way to achieve the same means. The script is provided “as is”. You are more than welcome to use and/or enhance the script.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: .5in 1.0in 1.5in 2.0in 2.5in 3.0in 3.5in 4.0in 4.5in 419.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Peter Zabback&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=851398" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/sqlqueryprocessing/attachment/851398.ashx" length="4190" type="application/octet-stream" /><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Statistics+Profile/default.aspx">Statistics Profile</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/SQL+Server+2005/default.aspx">SQL Server 2005</category></item><item><title>Introduction to Showplan</title><link>http://blogs.msdn.com/sqlqueryprocessing/archive/2006/09/29/introduction-to-showplan.aspx</link><pubDate>Sat, 30 Sep 2006 01:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:777445</guid><dc:creator>queryproc</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/sqlqueryprocessing/comments/777445.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlqueryprocessing/commentrss.aspx?PostID=777445</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;Showplan is a feature in SQL Server to display and read query plans. While some of you may already be very familiar with Showplan, it is one of the most important diagnostic tools that we use in the query processing team to locate and identify problems, and therefore deserves some extra exposure.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Being able to collect, read, and understand Showplan data is a critical skill to have, and one which we plan to blog about a fair bit.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Consider this an introductory posting to cover some of the basics which we will drill into more in further posts.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;We generate two types of Showplans in SQL Server, one at query compilation time (when an optimized query plan is produced) and&amp;nbsp;the second at query runtime (when the optimized&amp;nbsp;query plan is executed).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The former allows you to see the compiled query plan in its entirety, as well as a ton of useful information about each operator in the plan.&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;The runtime plan, often referred to as query execution “statistics”, enables you to collect actual metrics about the query during its execution, such as its execution time and actual cost. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;Showplan and statistics information can be extracted in two ways from the server, 1) using query SET options, 2) using Profiler Trace events. The various SET options available are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&lt;FONT size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Legacy Showplan&lt;o:p&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&lt;FONT size=3&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Compile Time:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms187735.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms187735.aspx"&gt;&lt;FONT face=Arial&gt;SET SHOWPLAN_ALL ON&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; or &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms176058.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms176058.aspx"&gt;&lt;FONT face=Arial&gt;SET SHOWPLAN_TEXT ON&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&lt;FONT size=3&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Runtime:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms187735.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms187735.aspx"&gt;&lt;FONT face=Arial&gt;SET STATISTICS PROFILE ON&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&lt;FONT size=3&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Showplan XML (Preferred)&lt;o:p&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&lt;FONT size=3&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Compile Time:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms187757.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms187757.aspx"&gt;&lt;FONT face=Arial&gt;SET SHOWPLAN_XML ON&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l0 level2 lfo1"&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"&gt;&lt;SPAN style="mso-list: Ignore"&gt;o&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&lt;FONT size=3&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Runtime:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms176107.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms176107.aspx"&gt;&lt;FONT face=Arial&gt;SET STATISTICS XML ON&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;SQL Server Management Studio (SSMS)&amp;nbsp;uses Showplan&amp;nbsp;to display a graphical representation of the query plan. A graphical view of&amp;nbsp;the query plan for the following&amp;nbsp;query on the ‘nwind’ database is shown in the picture below. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;-- Query: select customer name and order date for orders placed by customers in &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:country-region w:st="on"&gt;&lt;st1:place w:st="on"&gt;Canada&lt;/st1:place&gt;&lt;/st1:country-region&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;use&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; nwind&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;go&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;select&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; ContactName&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; OrderDate&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;from&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Customers &lt;SPAN style="COLOR: gray"&gt;inner&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;join&lt;/SPAN&gt; Orders &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;on&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Orders&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;CustomerID &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; Customers&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;CustomerID&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;where&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Orders&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;ShipCountry &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;'&lt;st1:country-region w:st="on"&gt;&lt;st1:place w:st="on"&gt;Canada&lt;/st1:place&gt;&lt;/st1:country-region&gt;'&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;go&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#000000 size=3&gt;(See the attached .bmp file for a picture of this showplan)&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;In SSMS, to view the graphical plan, click on the Execution Plan tab in the Results Pane. The graphical plan is read from top-to-bottom, right-to-left. When you select any operator in the query tree or simply hover the mouse on it, you will see a tooltip that describes the operator. It displays the Query Optimizer cost estimates (operator and subtree costs, number of rows, row size, etc.) and additional information like output columns, predicates, etc. The detailed operator information is shown in the Properties window (View --&amp;gt; Properties Window), which is&amp;nbsp;usually displayed on the extreme right frame in SSMS. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;To save the graphical showplan to a file you can&amp;nbsp;right click on the Execution Plan and select 'Save Execution Plan As'. The query plan is saved with extension '.sqlplan' and can be reloaded into SSMS anytime, sent via email, etc. &lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;Showplan output can be generated in text, grid or XML formats. The XML format was introduced in SQL Server 2005 which we refer to as “Showplan XML” and the other formats as “Legacy Showplan”. In the next posting we will describe how to generate and analyze Showplan XML.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;- &lt;A href="http://blogs.msdn.com/members/Steve.Herbert.aspx" mce_href="http://blogs.msdn.com/members/Steve.Herbert.aspx"&gt;Steve&lt;/A&gt; and Gargi&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=msolistparagraph0 style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial size=4&gt;&lt;/FONT&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/members/Steve.Herbert.aspx" mce_href="http://blogs.msdn.com/members/Steve.Herbert.aspx"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=777445" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/sqlqueryprocessing/attachment/777445.ashx" length="1102950" type="image/bmp" /><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Showplan_5F00_XML/default.aspx">Showplan_XML</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Showplan/default.aspx">Showplan</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Statistics+XML/default.aspx">Statistics XML</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/Statistics+Profile/default.aspx">Statistics Profile</category><category domain="http://blogs.msdn.com/sqlqueryprocessing/archive/tags/SQL+Server+2005/default.aspx">SQL Server 2005</category></item></channel></rss>