<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SQL Server SQLOS team blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sqlos/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sqlos/feed.xml</link>
    <description>Collective blog for SQLOS team</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:36:04 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SQLOS Team blog updates</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlos/sqlos-team-blog-updates</link>
      <pubDate>Fri, 25 Jun 2010 18:36:09 GMT</pubDate>
      <dc:creator><![CDATA[G Bowerman (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sqlos/2010/06/25/sqlos-team-blog-updates/</guid>
      <description><![CDATA[Please note that&nbsp;to save the need to check two different sites, future SQLOS team blog posts...]]></description>
      <content:encoded><![CDATA[<p>Please note that&nbsp;to save the need to check two different sites, future SQLOS team blog posts will be appearing on the MSDN site here: <a href="https://blogs.msdn.com/b/sqlosteam/">SQLOS Team Blog</a>.</p>
<p>Thanks, Guy.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to configure Soft-NUMA on a system with &gt; 32 processors?</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlos/how-to-configure-soft-numa-on-a-system-with-32-processors</link>
      <pubDate>Fri, 15 May 2009 18:10:00 GMT</pubDate>
      <dc:creator><![CDATA[harshiam]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sqlos/2009/05/15/how-to-configure-soft-numa-on-a-system-with-32-processors/</guid>
      <description><![CDATA[&nbsp;
I recently answered this&nbsp;customer question and was looking forward to post the solution...]]></description>
      <content:encoded><![CDATA[<H3 style="MARGIN: 10pt 0in 0pt">&nbsp;</H3>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>I recently answered this&nbsp;customer question and was looking forward to post the solution here. So here you go!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>There is already a lot of information about how Soft NUMA works and how to configure Soft NUMA on your system. So without delving into the basics, I am jumping right ahead to the topic.</FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3><o:p></o:p></FONT></SPAN>&nbsp;</P>
<H2 style="MARGIN: 10pt 0in 0pt"><FONT size=4><FONT color=#4f81bd><FONT face=Cambria>Soft Affinity Setting</FONT></FONT></FONT></H2>
<P style="MARGIN: 10pt 0in 0pt"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>SQL Server 2000 and above supports the affinity option for greater than 32 processors (33 to 64)&nbsp;only on 64-bit operating system.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>If you are running SQL Server 2000 or above on a system with greater than 32 processors, then you can use <B style="mso-bidi-font-weight: normal">sp_configure ‘affinity<SPAN style="mso-bidi-font-weight: bold"> mask’ </SPAN></B>(32 bit mask) option for the first 32 CPUs and <B style="mso-bidi-font-weight: normal">sp_configure ‘<SPAN style="mso-bidi-font-weight: bold">affinity64 mask’ </SPAN></B>(32 bit mask) option for the CPUs 33 to 64.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>Ex: Consider a machine with 33 CPUs. Setting the ‘affinity mask’ to 0x0000ffff and ‘affinity64 mask’ to 0x1 hard affinitizes CPU 1 to 16 and CPU 33 to ONLINE.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P>
<TABLE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-COLLAPSE: collapse; BORDER-TOP: medium none; BORDER-RIGHT: medium none; mso-border-alt: solid #404040 1.0pt; mso-border-themecolor: text1; mso-border-themetint: 191; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" class=MediumShading1 border=1 cellSpacing=0 cellPadding=0 class="MediumShading1">
<TBODY>
<TR style="HEIGHT: 146.75pt; mso-yfti-irow: -1; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD style="BORDER-BOTTOM: #404040 1pt solid; BORDER-LEFT: #404040 1pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 5.4pt; WIDTH: 6.15in; PADDING-RIGHT: 5.4pt; BACKGROUND: #bfbfbf; HEIGHT: 146.75pt; BORDER-TOP: #404040 1pt solid; BORDER-RIGHT: #404040 1pt solid; PADDING-TOP: 0in; mso-border-themecolor: text1; mso-border-themetint: 191; mso-background-themecolor: background1; mso-background-themeshade: 191" vAlign=top width=590>
<BLOCKQUOTE>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"></SPAN></B>&nbsp;</P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">sp_configure 'show advanced options', 1;<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">RECONFIGURE;<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">GO<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">sp_configure 'affinity mask', 65535;<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">RECONFIGURE;<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">GO<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">sp_configure ‘affinity64 mask’, 1;<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">RECONFIGURE;<o:p></o:p></SPAN></B></P>
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; VERTICAL-ALIGN: top; WORD-BREAK: break-all; mso-yfti-cnfc: 5" class=MsoNormal><B><SPAN style="LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">GO</SPAN></B><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><o:p></o:p></SPAN></B></P></BLOCKQUOTE></TD></TR></TBODY></TABLE></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<H2 style="MARGIN: 10pt 0in 0pt"><SPAN style="mso-fareast-font-family: 'Times New Roman'"><FONT size=4><FONT color=#4f81bd><FONT face=Cambria>Registry Settings</FONT></FONT></FONT></SPAN><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN>&nbsp;</H2><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 12pt; mso-themecolor: text2">To map Soft NUMA nodes to greater than 32 CPUs, use a QWORD registry value&nbsp;to represent CPUs 1 to 64. Use the Registry Editor program (regedit.exe) to add the following registry keys to map soft-NUMA to CPUs as follows.</SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal>Ex: Mapping Soft NUMA nodes to CPUs as follows:<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: 0.5in; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Node 0: CPUs 1 to 16<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: 0.5in; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Node 1: CPUs 17 to 32<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; TEXT-INDENT: 0.5in; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>Node 2: CPUs 33 and 34</FONT></SPAN> 
<P style="LINE-HEIGHT: 140%; MARGIN: 0in 0in 0pt; DISPLAY: none; COLOR: #1f497d; VERTICAL-ALIGN: top; mso-themecolor: text2; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoNormal mce_keep="true">&nbsp;</P>
<P>
<TABLE style="BORDER-BOTTOM: #dddddd 1pt solid; BORDER-LEFT: #dddddd 1pt solid; MARGIN: auto auto auto 1.75pt; WIDTH: 100%; BORDER-TOP: #dddddd 1pt solid; BORDER-RIGHT: #dddddd 1pt solid; mso-border-alt: solid #DDDDDD .75pt; mso-yfti-tbllook: 1184; mso-cellspacing: 1.5pt" class=MsoNormalTable border=1 cellPadding=0 width="100%" class="MsoNormalTable">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom>
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">SQL Server 2005 <o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom>
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">Type <o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom>
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">Value name <o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.38%; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">Value data <o:p></o:p></SPAN></B></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\NodeConfiguration\Node0<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">QWORD<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">CPUMask<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.38%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">0x 0000 0000 0000 ffff<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\NodeConfiguration\Node1<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">QWORD<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">CPUMask<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.38%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">0x0000 0000 ffff 0000<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3; mso-yfti-lastrow: yes">
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\NodeConfiguration\Node2<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">QWORD<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">CPUMask<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.38%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">0x0000 0002 0000 0000<o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P>
<TABLE style="BORDER-BOTTOM: #dddddd 1pt solid; BORDER-LEFT: #dddddd 1pt solid; MARGIN: auto 6.75pt; WIDTH: 99.94%; BORDER-TOP: #dddddd 1pt solid; BORDER-RIGHT: #dddddd 1pt solid; mso-border-alt: solid #DDDDDD .75pt; mso-yfti-tbllook: 1184; mso-cellspacing: 1.5pt; mso-table-lspace: 9.0pt; mso-table-rspace: 9.0pt; mso-table-anchor-vertical: paragraph; mso-table-anchor-horizontal: margin; mso-table-left: left; mso-table-top: -1.8pt" class=MsoNormalTable border=1 cellPadding=0 width="99%" align=left class="MsoNormalTable">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 52.16%; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom width="52%">
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">SQL Server 2008 <o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 9.82%; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom width="9%">
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">Type <o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 10.36%; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom width="10%">
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">Value name <o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-BOTTOM: #c8cdde 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.1%; PADDING-RIGHT: 3.75pt; BACKGROUND: #cccccc; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #cccccc 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .25pt; mso-border-bottom-alt: solid #C8CDDE .75pt" vAlign=bottom width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 3.75pt 0in; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">Value data <o:p></o:p></SPAN></B></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 52.16%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="52%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\NodeConfiguration\Node0<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 9.82%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="9%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">QWORD<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 10.36%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="10%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">CPUMask<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.1%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">0x 0000 0000 0000 ffff<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 52.16%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="52%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\NodeConfiguration\Node1<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 9.82%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="9%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">QWORD<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 10.36%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="10%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">CPUMask<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.1%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">0x0000 0000 ffff 0000<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3; mso-yfti-lastrow: yes">
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 52.16%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="52%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\NodeConfiguration\Node2<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 9.82%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="9%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">QWORD<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 10.36%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="10%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">CPUMask<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-BOTTOM: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; PADDING-BOTTOM: 3.75pt; PADDING-LEFT: 3.75pt; WIDTH: 26.1%; PADDING-RIGHT: 3.75pt; BACKGROUND: white; BORDER-TOP: #cccccc 1pt solid; BORDER-RIGHT: #d5d5d3 1pt solid; PADDING-TOP: 3.75pt; mso-border-alt: solid #CCCCCC .75pt; mso-border-right-alt: solid #D5D5D3 .75pt" vAlign=top width="26%">
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0.75pt 0pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: margin; mso-element-top: -1.8pt; mso-height-rule: exactly" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2">0x0000 0003 0000 0000<o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>Rest of the details about using Soft NUMA and mapping the registry key remains the same.<o:p></o:p></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-themecolor: text2"><FONT size=3>If the registry is having faulty settings like overlapping NUMA node masks to CPU mapping or Soft NUMA mapping crossing hardware NUMA, then SQL Server ignores the Soft NUMA configuration.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3>Good news is that the new version of SQL Server (after SQL Server 2008) will be supporting greater than 64 logical processors and will be using a more convenient way for setting affinity!</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3></FONT></SPAN>&nbsp;</P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3>-Harshitha Amit</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #1f497d; mso-themecolor: text2"><FONT size=3>SQLOS Test Team</FONT></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Debugging slow response times in SQL Server 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlos/debugging-slow-response-times-in-sql-server-2008</link>
      <pubDate>Fri, 18 Jul 2008 18:56:00 GMT</pubDate>
      <dc:creator><![CDATA[IvanPe]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sqlos/2008/07/18/debugging-slow-response-times-in-sql-server-2008/</guid>
      <description><![CDATA[Introduction
The other day I came across a nice article written by Mario Broodbakker called "SQL...]]></description>
      <content:encoded><![CDATA[<H1>Introduction</H1>
<P>The other day I came across a nice article written by Mario Broodbakker called "SQL Server Wait Events: Taking the Guesswork out of Performance Profiling"&nbsp;(see references) on how to troubleshoot slow response times in SQL Server 2000 and 2005 using the YAPP Method. According to the author, one of the biggest challenges to apply this method in SQL Server is that fact that the wait statistics are collected and exposed at the server level (server wide):</P>
<P><EM>... "This is simply not enough, unless you have the luxury of testing your application and SQL statements on an isolated server" ..." But, of course, it's often hard or impossible to isolate and replicate production problems on an isolated test server." ...</EM></P>
<P>I decided to write this because in SQL Server 2008 the wait statistics are available at virtually any level, and (at the time of writing) I couldn't find any articles on the new <B>sqlos.wait_info</B> and <STRONG>sqlos.wait_info_external</STRONG> extended events.</P>
<H1>YAPP Method</H1>
<P>The YAPP Method: "Yet Another Performance Profiling Method" is based on a paper written by Anjo Kolk (see references). The basic idea of the method can be expressed with the following formula:</P>
<P><B>(1)&nbsp;&nbsp; </B><B>Response time = service time + wait time</B></P>
<P>This method for performance troubleshooting has been around for some time and it is a fairly standard practice when debugging slow response times.</P>
<P>You can get the <B>response time</B> and the <B>service time</B> of a query by looking at <B>sys.dm_exec_sessions</B>, columns total_elapsed_time and cpu_time. Alternatively, you can use SQL trace or the more lightweight extended events in SQL Server 2008. Knowing <B>response time</B> and <B>service time</B> and applying formula <B>(1)</B>, gives you <B>wait time</B>. So, we know how much we waited. However, in order to get the individual wait types we need the new extended events. </P>
<H1>Per session wait statistics in SQL Server 2008</H1>
<P>In SQL Server 2008 you can get wait statistics for a given session or statement by leveraging the new extended events. Optionally, you can limit the collection to a small set of wait types or collect only waits exceeding certain duration. If your event session is written carefully, you can use this technique on production systems with very little or no performance impact. In fact, SQL Server 2008 ships with a built-in event session, which is collecting wait statistics, and is running by default out of the box.</P>
<P>Here is how to create an event session to collect wait types for session 51. The events will go to the specified trace file:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">add</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> sqlos<SPAN style="COLOR: gray">.</SPAN>wait_info<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">WHERE</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> sqlserver<SPAN style="COLOR: gray">.</SPAN>session_id<SPAN style="COLOR: gray">=</SPAN>51 <SPAN style="COLOR: gray">and</SPAN> duration<SPAN style="COLOR: gray">&gt;</SPAN>0<SPAN style="COLOR: gray">)<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">,</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">add</SPAN> <SPAN style="COLOR: blue">event</SPAN> sqlos<SPAN style="COLOR: gray">.</SPAN>wait_info_external<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">WHERE</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> sqlserver<SPAN style="COLOR: gray">.</SPAN>session_id<SPAN style="COLOR: gray">=</SPAN>51 <SPAN style="COLOR: gray">and</SPAN> duration<SPAN style="COLOR: gray">&gt;</SPAN>0<SPAN style="COLOR: gray">)<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">add</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">target</SPAN> package0<SPAN style="COLOR: gray">.</SPAN>asynchronous_file_target<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">SET</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">filename</SPAN><SPAN style="COLOR: gray">=</SPAN><SPAN style="COLOR: red">N'c:\wait_stats.xel'</SPAN><SPAN style="COLOR: gray">,</SPAN> metadatafile<SPAN style="COLOR: gray">=</SPAN><SPAN style="COLOR: red">N'c:\wait_stats.xem'</SPAN><SPAN style="COLOR: gray">);</SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: gray"></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: gray"><o:p></o:p></SPAN></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: gray"><o:p></o:p></SPAN></SPAN></P>
<P>Here is how to start the event session, run your workload, and then stop the event session: </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">alter</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server</SPAN> <SPAN style="COLOR: blue">state</SPAN> <SPAN style="COLOR: gray">=</SPAN> start;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> sp_workload<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">alter</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server</SPAN> <SPAN style="COLOR: blue">state</SPAN> <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: blue">stop;</SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: blue"></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: blue"><o:p></o:p></SPAN></SPAN>&nbsp;</P>
<P mce_keep="true">Here is how to read the trace file:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: gray">*</SPAN> <SPAN style="COLOR: blue">from</SPAN> <SPAN style="COLOR: blue">from</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN>fn_xe_file_target_read_file</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">'c:\wait_stats*.xel'</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">,</SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"> <SPAN style="COLOR: red">'c:\wait_stats*.xem'</SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: gray">null,</SPAN> <SPAN style="COLOR: gray">null)</SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"><SPAN style="COLOR: gray"></SPAN></SPAN>&nbsp;</P>
<P>The result is a list of wait events, representing individual waits, having wait type and duration column. In order to make better sense out of this we need to group the events by wait type and calculate the total duration per wait type. The following code can do this:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>read_xe_file <SPAN style="COLOR: blue">as<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: fuchsia">object_name</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: blue">event</SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: fuchsia">CONVERT</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: blue">xml</SPAN><SPAN style="COLOR: gray">,</SPAN> event_data<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> data<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">from</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN>fn_xe_file_target_read_file<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">'c:\wait_stats*.xel'</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">,</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: red">'c:\wait_stats*.xem'</SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: gray">null,</SPAN> <SPAN style="COLOR: gray">null)<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>xe_file_table <SPAN style="COLOR: blue">as<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">event<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> data<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'(/event/data/text)[1]'</SPAN><SPAN style="COLOR: gray">,</SPAN><SPAN style="COLOR: red">'nvarchar(50)'</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'wait_type'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> data<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'(/event/data/value)[3]'</SPAN><SPAN style="COLOR: gray">,</SPAN><SPAN style="COLOR: red">'int'</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> data<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'(/event/data/value)[6]'</SPAN><SPAN style="COLOR: gray">,</SPAN><SPAN style="COLOR: red">'int'</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'signal_duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">from</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> dbo<SPAN style="COLOR: gray">.</SPAN>read_xe_file<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"></SPAN>&nbsp;</P><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>wait_type<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: gray">,</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: fuchsia">sum</SPAN><SPAN style="COLOR: gray">(</SPAN><FONT color=#000000>duration</FONT><SPAN style="COLOR: gray">)</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: blue">as</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: red">'total_duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: gray">,</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: fuchsia">sum</SPAN><SPAN style="COLOR: gray">(</SPAN><FONT color=#000000>signal_duration</FONT><SPAN style="COLOR: gray">)</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: blue">as</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: red">'total_signal_duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">from</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000> dbo</FONT><SPAN style="COLOR: gray">.</SPAN><FONT color=#000000>xe_file_table<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">group</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000> </FONT><SPAN style="COLOR: blue">by</SPAN><FONT color=#000000> wait_type<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">order</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000> </FONT><SPAN style="COLOR: blue">by</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: fuchsia">sum</SPAN><SPAN style="COLOR: gray">(</SPAN><FONT color=#000000>duration</FONT><SPAN style="COLOR: gray">)</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: blue">desc<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"></SPAN><FONT face=Calibri size=3></FONT>&nbsp;</P>
<H1>Example</H1>
<P>Hopefully this example will demonstrate the power of <B>sqlos.wait_info</B> and <STRONG>sqlos.wait_info_external</STRONG> events. I did some measurements by executing the following workload from two connections:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">proc</SPAN> #sp_workload<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">as<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">begin<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> <SPAN style="COLOR: blue">nocount</SPAN> <SPAN style="COLOR: blue">ON<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">CREATE</SPAN> <SPAN style="COLOR: blue">TABLE</SPAN> #t1000k<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: gray">(</SPAN>c2 <SPAN style="COLOR: blue">char</SPAN><SPAN style="COLOR: gray">(</SPAN>1020<SPAN style="COLOR: gray">));<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">TRANSACTION<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @rows <SPAN style="COLOR: blue">INT</SPAN> <SPAN style="COLOR: gray">=</SPAN> 50000<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @row <SPAN style="COLOR: blue">INT</SPAN> <SPAN style="COLOR: gray">=</SPAN> 0<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @count <SPAN style="COLOR: blue">INT</SPAN> <SPAN style="COLOR: gray">=</SPAN> 0<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">WHILE</SPAN> @row <SPAN style="COLOR: gray">&lt;</SPAN> @rows<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">INSERT</SPAN> <SPAN style="COLOR: blue">INTO</SPAN> #t1000k<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: gray">(</SPAN>c2<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">VALUES </SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: fuchsia">REPLICATE</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'a'</SPAN><SPAN style="COLOR: gray">,</SPAN>1000<SPAN style="COLOR: gray">));<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SELECT</SPAN> @row <SPAN style="COLOR: gray">=</SPAN> @row <SPAN style="COLOR: gray">+</SPAN> 1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">IF</SPAN> @count <SPAN style="COLOR: gray">&gt;</SPAN> 10<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">COMMIT<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">TRANSACTION<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SELECT</SPAN> @count<SPAN style="COLOR: gray">=</SPAN>0<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">END<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SELECT</SPAN> @count<SPAN style="COLOR: gray">=</SPAN>@count<SPAN style="COLOR: gray">+</SPAN>1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">END<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">COMMIT<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END<o:p></o:p></SPAN></P>
<P mce_keep="true"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-no-proof: yes; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">go</SPAN></P>
<P>While running the workload I had <B>IOMeter</B> (see references) so that I can add some disk pressure.</P>
<P><B>Results for session 51: </B>Apparently, most of the time was spent waiting for space in the log buffer to store log records - wait type LOGBUFFER. For complete list of all wait types with their descriptions search for <B>sys.dm_os_wait_stats</B> in MSDN or Books Online (see references). </P>
<P>
<TABLE class="" style="WIDTH: 401pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=535 border=0>
<COLGROUP>
<COL style="WIDTH: 199pt; mso-width-source: userset; mso-width-alt: 9443" width=266>
<COL style="WIDTH: 87pt; mso-width-source: userset; mso-width-alt: 4124" width=116>
<COL style="WIDTH: 115pt; mso-width-source: userset; mso-width-alt: 5432" width=153>
<TBODY>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 199pt; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: #d8d8d8" width=266 height=19 class="xl65"><FONT face=Calibri size=3><STRONG>Response time</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 87pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" width=116 class="xl65"><FONT face=Calibri size=3><STRONG>Service time</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 115pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" width=153 class="xl65"><STRONG><FONT face=Calibri size=3>Wait time</FONT></STRONG></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>32619</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>1828</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>30791</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3></FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3></FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3></FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: #d8d8d8" height=19 class="xl65"><FONT face=Calibri size=3><STRONG>wait_type</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" class="xl65"><FONT face=Calibri size=3><STRONG>total_duration</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" class="xl65"><STRONG><FONT face=Calibri size=3>total_signal_duration</FONT></STRONG></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>LOGBUFFER</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>9662</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>66</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PREEMPTIVE_OS_FILEOPS</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>6442</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>276</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PREEMPTIVE_OS_FLUSHFILEBUFFERS</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>3833</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>150</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PREEMPTIVE_OS_WRITEFILEGATHER</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>3015</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>66</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>SOS_SCHEDULER_YIELD</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>2481</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>2480</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>WRITE_COMPLETION</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>1971</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>IO_COMPLETION</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>1183</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PAGEIOLATCH_UP</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>551</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>WRITELOG</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>417</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PAGELATCH_UP</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>30</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>27</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PAGELATCH_SH</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>10</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>10</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PREEMPTIVE_XE_CALLBACKEXECUTE</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>4</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>200</FONT></TD></TR></TBODY></TABLE></P>
<P mce_keep="true"><B></B>&nbsp;</P>
<P mce_keep="true"><B>Results for session 52: </B>The result for this session is very similar. We can tell that most of the time was spent waiting. After accumulating the durations from all waits we get 30726, which is pretty close to the total wait time calculated using <STRONG>sys.dm_exec_sessions </STRONG>(31484).</P>
<P mce_keep="true">
<TABLE class="" style="WIDTH: 401pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=535 border=0>
<COLGROUP>
<COL style="WIDTH: 199pt; mso-width-source: userset; mso-width-alt: 9443" width=266>
<COL style="WIDTH: 87pt; mso-width-source: userset; mso-width-alt: 4124" width=116>
<COL style="WIDTH: 115pt; mso-width-source: userset; mso-width-alt: 5432" width=153>
<TBODY>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 199pt; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: #d8d8d8" width=266 height=19 class="xl65"><FONT face=Calibri size=3><STRONG>Response time</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 87pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" width=116 class="xl65"><FONT face=Calibri size=3><STRONG>Service time</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 115pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" width=153 class="xl65"><STRONG><FONT face=Calibri size=3>Wait time</FONT></STRONG></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>33890</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>2406</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>31484</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3></FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3></FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3></FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: #d8d8d8" height=19 class="xl65"><FONT face=Calibri size=3><STRONG>wait_type</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" class="xl65"><FONT face=Calibri size=3><STRONG>total_duration</STRONG></FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #d8d8d8" class="xl65"><STRONG><FONT face=Calibri size=3>total_signal_duration</FONT></STRONG></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>LATCH_EX</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>16555</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>32</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>LOGBUFFER</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>10796</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>28</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>SOS_SCHEDULER_YIELD</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>2739</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>2729</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>WRITELOG</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>605</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PAGELATCH_UP</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>26</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>25</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl66"><FONT face=Calibri size=3>PAGELATCH_SH</FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl67"><FONT face=Calibri size=3>5</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl66"><FONT face=Calibri size=3>5</FONT></TD></TR></TBODY></TABLE></P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">For the sake of completeness I also collected server-wide wait statistics, which are also available in previous version of SQL Server. The server-wide statistics clearly shows that we have IO bottleneck however you don't know exactly which session or query was affected and by how much:</P>
<P mce_keep="true">&nbsp; 
<TABLE class="" style="WIDTH: 445pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=592 border=0>
<COLGROUP>
<COL style="WIDTH: 220pt; mso-width-source: userset; mso-width-alt: 10410" width=293>
<COL style="WIDTH: 110pt; mso-width-source: userset; mso-width-alt: 5205" width=146>
<COL style="WIDTH: 115pt; mso-width-source: userset; mso-width-alt: 5432" width=153>
<TBODY>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 220pt; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: #bfbfbf" width=293 height=19 class="xl67"><FONT face=Calibri size=3><STRONG>wait_type</STRONG></FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 110pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #bfbfbf" width=146 class="xl67"><FONT face=Calibri size=3><STRONG>wait_time_ms</STRONG></FONT></TD>
<TD class=xl67 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 115pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: #bfbfbf" width=153 class="xl67"><STRONG><FONT face=Calibri size=3>signal_wait_time_ms</FONT></STRONG></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>LOGBUFFER</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>21666</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>127</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>WRITELOG</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>17118</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>4</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>LATCH_EX</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>16561</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>34</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PAGEIOLATCH_UP</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>7891</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>SOS_SCHEDULER_YIELD</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>7058</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>7038</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_FILEOPS</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>6443</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>WRITE_COMPLETION</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>5896</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>4</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>SLEEP_BPOOL_FLUSH</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>3916</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>278</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_FLUSHFILEBUFFERS</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>3833</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_WRITEFILEGATHER</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>3016</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>IO_COMPLETION</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>1680</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_REPORTEVENT</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>141</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PAGELATCH_UP</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>139</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>128</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_PIPEOPS</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>128</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_XE_TARGETINIT</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>85</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>XE_BUFFERMGR_ALLPROCESSED_EVENT</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>70</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PAGELATCH_SH</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>23</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>23</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_QUERYREGISTRY</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>16</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_XE_CALLBACKEXECUTE</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>8</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PAGELATCH_EX</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>7</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>7</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_XE_SESSIONCOMMIT</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>5</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>LATCH_SH</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>1</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR>
<TR style="HEIGHT: 14.4pt" height=19>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; HEIGHT: 14.4pt; BACKGROUND-COLOR: transparent" height=19 class="xl65"><FONT face=Calibri size=3>PREEMPTIVE_OS_GETDISKFREESPACE</FONT></TD>
<TD class=xl66 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: yellow" class="xl66"><FONT face=Calibri size=3>1</FONT></TD>
<TD class=xl65 style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" class="xl65"><FONT face=Calibri size=3>0</FONT></TD></TR></TBODY></TABLE></P>
<P mce_keep="true">&nbsp;</P>
<H1>Complete test code</H1>
<P>Here is the complete source code of the test:</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">use</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> tempdb<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">--<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">-- Enable xp_cmdshell to delete trace files<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">--<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: maroon">sp_configure</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">'show advanced options'</SPAN><SPAN style="COLOR: gray">,</SPAN> 1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">reconfigure<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: maroon">sp_configure</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">'xp_cmdshell'</SPAN><SPAN style="COLOR: gray">,</SPAN> 1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">reconfigure<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">BEGIN</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">drop</SPAN> <SPAN style="COLOR: blue">proc</SPAN> #sp_workload<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY</SPAN> <SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">CATCH</SPAN> <SPAN style="COLOR: blue">END</SPAN> <SPAN style="COLOR: blue">CATCH<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">proc</SPAN> #sp_workload<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">as<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">begin<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> <SPAN style="COLOR: blue">nocount</SPAN> <SPAN style="COLOR: blue">ON<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">CREATE</SPAN> <SPAN style="COLOR: blue">TABLE</SPAN> #t1000k<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: gray">(</SPAN>c2 <SPAN style="COLOR: blue">char</SPAN><SPAN style="COLOR: gray">(</SPAN>1020<SPAN style="COLOR: gray">));<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">TRANSACTION<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @rows <SPAN style="COLOR: blue">INT</SPAN> <SPAN style="COLOR: gray">=</SPAN> 50000<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @row <SPAN style="COLOR: blue">INT</SPAN> <SPAN style="COLOR: gray">=</SPAN> 0<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @count <SPAN style="COLOR: blue">INT</SPAN> <SPAN style="COLOR: gray">=</SPAN> 0<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">WHILE</SPAN> @row <SPAN style="COLOR: gray">&lt;</SPAN> @rows<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">INSERT</SPAN> <SPAN style="COLOR: blue">INTO</SPAN> #t1000k<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: gray">(</SPAN>c2<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">VALUES </SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: fuchsia">REPLICATE</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'a'</SPAN><SPAN style="COLOR: gray">,</SPAN>1000<SPAN style="COLOR: gray">));<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SELECT</SPAN> @row <SPAN style="COLOR: gray">=</SPAN> @row <SPAN style="COLOR: gray">+</SPAN> 1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">IF</SPAN> @count <SPAN style="COLOR: gray">&gt;</SPAN> 10<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">COMMIT<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">TRANSACTION<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SELECT</SPAN> @count<SPAN style="COLOR: gray">=</SPAN>0<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">END<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SELECT</SPAN> @count<SPAN style="COLOR: gray">=</SPAN>@count<SPAN style="COLOR: gray">+</SPAN>1<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">END<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">COMMIT<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">BEGIN</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">drop</SPAN> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY</SPAN> <SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">CATCH</SPAN> <SPAN style="COLOR: blue">END</SPAN> <SPAN style="COLOR: blue">CATCH<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: maroon">xp_cmdshell</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">'del c:\wait_stats*.xel'</SPAN><SPAN style="COLOR: gray">,</SPAN> no_output<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: maroon">xp_cmdshell</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">'del c:\wait_stats*.xem'</SPAN><SPAN style="COLOR: gray">,</SPAN> no_output<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">declare</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> @cmd <SPAN style="COLOR: blue">nvarchar</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: fuchsia">max</SPAN><SPAN style="COLOR: gray">);<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">set</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> @cmd <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: red">N'create event session session_waits on server '</SPAN> <SPAN style="COLOR: gray">+<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: red">N'add event sqlos.wait_info (WHERE sqlserver.session_id='</SPAN> <SPAN style="COLOR: gray">+</SPAN> <SPAN style="COLOR: fuchsia">convert</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: blue">nvarchar</SPAN><SPAN style="COLOR: gray">(</SPAN>10<SPAN style="COLOR: gray">),</SPAN> <SPAN style="COLOR: fuchsia">@@spid</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: gray">+</SPAN> <SPAN style="COLOR: red">N' and duration&gt;0) '</SPAN> <SPAN style="COLOR: gray">+<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: red">N', add event sqlos.wait_info_external (WHERE sqlserver.session_id='</SPAN> <SPAN style="COLOR: gray">+</SPAN> <SPAN style="COLOR: fuchsia">convert</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: blue">nvarchar</SPAN><SPAN style="COLOR: gray">(</SPAN>10<SPAN style="COLOR: gray">),</SPAN> <SPAN style="COLOR: fuchsia">@@spid</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: gray">+</SPAN> <SPAN style="COLOR: red">N' and duration&gt;0) '</SPAN> <SPAN style="COLOR: gray">+<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: red">N'add target package0.asynchronous_file_target (SET filename=N''c:\wait_stats.xel'', metadatafile=N''c:\wait_stats.xem'')'</SPAN><SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">@cmd<SPAN style="COLOR: gray">);<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">BEGIN</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">drop</SPAN> <SPAN style="COLOR: blue">table</SPAN> #snapshot<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY</SPAN> <SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">CATCH</SPAN> <SPAN style="COLOR: blue">END</SPAN> <SPAN style="COLOR: blue">CATCH<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> total_elapsed_time<SPAN style="COLOR: gray">,</SPAN> cpu_time <SPAN style="COLOR: blue">into</SPAN> #snapshot <SPAN style="COLOR: blue">from</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">dm_exec_sessions</SPAN> <SPAN style="COLOR: blue">where</SPAN> session_id<SPAN style="COLOR: gray">=</SPAN><SPAN style="COLOR: fuchsia">@@SPID</SPAN><SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">alter</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server</SPAN> <SPAN style="COLOR: blue">state</SPAN> <SPAN style="COLOR: gray">=</SPAN> start<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> #sp_workload<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">alter</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server</SPAN> <SPAN style="COLOR: blue">state</SPAN> <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: blue">stop</SPAN><SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">es<SPAN style="COLOR: gray">.</SPAN>total_elapsed_time <SPAN style="COLOR: gray">-</SPAN> ss<SPAN style="COLOR: gray">.</SPAN>total_elapsed_time<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'Response time'</SPAN><SPAN style="COLOR: gray">,<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">(</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">es<SPAN style="COLOR: gray">.</SPAN>cpu_time <SPAN style="COLOR: gray">-</SPAN> ss<SPAN style="COLOR: gray">.</SPAN>cpu_time<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'Service time'</SPAN><SPAN style="COLOR: gray">,<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">((</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">es<SPAN style="COLOR: gray">.</SPAN>total_elapsed_time <SPAN style="COLOR: gray">-</SPAN> ss<SPAN style="COLOR: gray">.</SPAN>total_elapsed_time<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: gray">-</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: gray">(</SPAN>es<SPAN style="COLOR: gray">.</SPAN>cpu_time <SPAN style="COLOR: gray">-</SPAN> ss<SPAN style="COLOR: gray">.</SPAN>cpu_time<SPAN style="COLOR: gray">))</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'Wait time'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">from</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">dm_exec_sessions</SPAN> es<SPAN style="COLOR: gray">,</SPAN> #snapshot ss <SPAN style="COLOR: blue">where</SPAN> session_id<SPAN style="COLOR: gray">=</SPAN><SPAN style="COLOR: fuchsia">@@SPID</SPAN><SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">drop</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">event</SPAN> <SPAN style="COLOR: blue">session</SPAN> session_waits <SPAN style="COLOR: blue">on</SPAN> <SPAN style="COLOR: blue">server<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">BEGIN</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">drop</SPAN> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>read_xe_file <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY</SPAN> <SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">CATCH</SPAN> <SPAN style="COLOR: blue">END</SPAN> <SPAN style="COLOR: blue">CATCH<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>read_xe_file <SPAN style="COLOR: blue">as<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: fuchsia">object_name</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: blue">event</SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: fuchsia">CONVERT</SPAN><SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: blue">xml</SPAN><SPAN style="COLOR: gray">,</SPAN> event_data<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> data<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">from</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN>fn_xe_file_target_read_file<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'c:\wait_stats*.xel'</SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: red">'c:\wait_stats*.xem'</SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: gray">null,</SPAN> <SPAN style="COLOR: gray">null)<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">BEGIN</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">drop</SPAN> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>xe_file_table <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">END</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">TRY</SPAN> <SPAN style="COLOR: blue">BEGIN</SPAN> <SPAN style="COLOR: blue">CATCH</SPAN> <SPAN style="COLOR: blue">END</SPAN> <SPAN style="COLOR: blue">CATCH<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">create</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>xe_file_table <SPAN style="COLOR: blue">as<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">event<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> data<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'(/event/data/text)[1]'</SPAN><SPAN style="COLOR: gray">,</SPAN><SPAN style="COLOR: red">'nvarchar(50)'</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'wait_type'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> data<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'(/event/data/value)[3]'</SPAN><SPAN style="COLOR: gray">,</SPAN><SPAN style="COLOR: red">'int'</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> data<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">(</SPAN><SPAN style="COLOR: red">'(/event/data/value)[6]'</SPAN><SPAN style="COLOR: gray">,</SPAN><SPAN style="COLOR: red">'int'</SPAN><SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'signal_duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">from</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> dbo<SPAN style="COLOR: gray">.</SPAN>read_xe_file<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">select<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>wait_type<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: fuchsia">sum</SPAN><SPAN style="COLOR: gray">(</SPAN>duration<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'total_duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: fuchsia">sum</SPAN><SPAN style="COLOR: gray">(</SPAN>signal_duration<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">as</SPAN> <SPAN style="COLOR: red">'total_signal_duration'<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">from</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> dbo<SPAN style="COLOR: gray">.</SPAN>xe_file_table<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">group</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">by</SPAN> wait_type<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">order</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">by</SPAN> <SPAN style="COLOR: fuchsia">sum</SPAN><SPAN style="COLOR: gray">(</SPAN>duration<SPAN style="COLOR: gray">)</SPAN> <SPAN style="COLOR: blue">desc<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">go<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">--<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">-- CLEANUP<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">--<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: maroon">xp_cmdshell</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">'del c:\wait_stats*.xel'</SPAN><SPAN style="COLOR: gray">,</SPAN> no_output<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">exec</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: maroon">xp_cmdshell</SPAN><SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">'del c:\wait_stats*.xem'</SPAN><SPAN style="COLOR: gray">,</SPAN> no_output<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">drop</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>xe_file_table<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">drop</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">view</SPAN> dbo<SPAN style="COLOR: gray">.</SPAN>read_xe_file<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">drop</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">proc</SPAN> #sp_workload<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></SPAN></P>
<P mce_keep="true">&nbsp;</P>
<H1>References</H1>
<H2>Sys.dm_os_wait_stats</H2>
<P>The following MSDN article shows all wait types with their description: <A href="https://msdn.microsoft.com/en-us/library/ms179984.aspx" mce_href="https://msdn.microsoft.com/en-us/library/ms179984.aspx">https://msdn.microsoft.com/en-us/library/ms179984.aspx</A></P>
<H2>IOMeter</H2>
<P>IOMeter is an IO stress and measurement tool developed by Intel. It is now an Open Source tool, and freely downloadable from:</P>
<P><A href="https://www.iometer.org/">https://www.iometer.org</A></P>
<H2>SQL Server Wait Events: Taking the Guesswork out of Performance Profiling</H2>
<P>A very nice article by Mario Broodbakker on how to troubleshoot slow response times in SQL Server 2000 and SQL Server 2005:</P>
<P><A href="https://www.simple-talk.com/sql/performance/sql-server-wait-events-taking-the-guesswork-out-of-performance-profiling/" mce_href="https://www.simple-talk.com/sql/performance/sql-server-wait-events-taking-the-guesswork-out-of-performance-profiling/">https://www.simple-talk.com/sql/performance/sql-server-wait-events-taking-the-guesswork-out-of-performance-profiling/</A></P>
<H2>Troubleshooting Performance Problems in SQL Server 2005</H2>
<P>Here also has a very good presentation on the subject and describes a lot of SQL Server 2005 wait events here:</P>
<P><A href="https://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx" mce_href="https://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx">https://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx</A></P>]]></content:encoded>
    </item>
    <item>
      <title>Part 2: Resource Governor CPU Demo on multiple CPUs</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlos/part-2-resource-governor-cpu-demo-on-multiple-cpus</link>
      <pubDate>Fri, 18 Jan 2008 23:00:00 GMT</pubDate>
      <dc:creator><![CDATA[BorisB]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sqlos/2008/01/18/part-2-resource-governor-cpu-demo-on-multiple-cpus/</guid>
      <description><![CDATA[In some cases CPU demo described in the previous post may behave not as expected.
One such case is...]]></description>
      <content:encoded><![CDATA[<P>In some cases CPU demo described in <A class="" href="https://blogs.technet.com/sqlos/archive/2007/12/14/part-1-anatomy-of-sql-server-2008-resource-governor-cpu-demo.aspx" target=_blank mce_href="https://blogs.technet.com/sqlos/archive/2007/12/14/part-1-anatomy-of-sql-server-2008-resource-governor-cpu-demo.aspx">the previous post</A> may behave not as expected.</P>
<P mce_keep="true">One such case is doing the demo on multiple CPUs. Even though it appears as Resource Governor is "not working", it is "by design". Let's take a look at what happens in this case.</P>
<P mce_keep="true">What is our promise about CPU bandwidth distribution?</P>
<P>When you specify percentage on the pool we will ensure <I>average </I>CPU bandwidth distribution on <I>per scheduler</I> basis for<I> CPU bound </I>workloads. Note, emphasis: average, per scheduler, CPU bound. What does this mean?</P>
<P mce_keep="true">For example, you have a 2 CPU machine, and SQL Server runs on both of the CPUs. If you haven't set affinity mask as was indicated in the Setup step of the previous post,</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">select</SPAN> scheduler_id<SPAN style="COLOR: gray">,</SPAN> cpu_id<SPAN style="COLOR: gray">,</SPAN> <SPAN style="COLOR: blue">status</SPAN><SPAN style="COLOR: gray">,</SPAN> is_online <SPAN style="COLOR: blue">from</SPAN> <SPAN style="COLOR: green">sys.dm_os_schedulers</SPAN></FONT></P></DIV>
<P mce_keep="true">will get you something like:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">scheduler_id cpu_id<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>status<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>is_online</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">------------ ----------- ------------------------------------------------------------ ---------</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">0<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>0<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>VISIBLE ONLINE<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>1</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">1<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>1<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>VISIBLE ONLINE<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>1</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">257<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>0<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>HIDDEN ONLINE<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>1</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">255<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>0<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>VISIBLE ONLINE (DAC)<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>1</FONT></P></DIV>
<P mce_keep="true">Important item to note here is that we have 2 online schedulers to service normal user requests (scheduler_id &lt; 255). You can compare it with the case when affinity mask is set to 1. You will still have 2 schedulers (with scheduler_id &lt; 255), but one of them will be offline.</P>
<P mce_keep="true">Now, for simplicity, let's configure 2 groups and 2 pools as follows:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> RESOURCE POOL pSlow<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">WITH</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <SPAN style="COLOR: gray">(</SPAN>MAX_CPU_PERCENT <SPAN style="COLOR: gray">=</SPAN> 30<SPAN style="COLOR: gray">)<o:p></o:p></SPAN></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; mso-bidi-font-size: 16.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> RESOURCE POOL pFast<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">WITH</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <SPAN style="COLOR: gray">(</SPAN>MAX_CPU_PERCENT <SPAN style="COLOR: gray">=</SPAN> 70<SPAN style="COLOR: gray">)<o:p></o:p></SPAN></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; mso-bidi-font-size: 16.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> WORKLOAD <SPAN style="COLOR: blue">GROUP</SPAN> gSlow<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">USING</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> pSlow<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> WORKLOAD <SPAN style="COLOR: blue">GROUP</SPAN> gFast<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">USING</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> pFast<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P></DIV>
<P mce_keep="true">And corresponding classifier function as</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: blue">FUNCTION</SPAN> f1<SPAN style="COLOR: gray">()<o:p></o:p></SPAN></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue">RETURNS</SPAN><SPAN style="FONT-SIZE: 10pt"> <SPAN style="COLOR: blue">SYSNAME</SPAN> <SPAN style="COLOR: blue">WITH</SPAN> <SPAN style="COLOR: blue">SCHEMABINDING<o:p></o:p></SPAN></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue"><FONT face="Courier New">BEGIN<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @val <SPAN style="COLOR: blue">sysname<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> <SPAN style="COLOR: red">'UserSlow'</SPAN> <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: fuchsia">SUSER_SNAME</SPAN><SPAN style="COLOR: gray">()<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> @val <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: red">'gSlow'</SPAN><SPAN style="COLOR: gray">;<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">else</SPAN> <SPAN style="COLOR: blue">if</SPAN> <SPAN style="COLOR: red">'UserFast'</SPAN> <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: fuchsia">SUSER_SNAME</SPAN><SPAN style="COLOR: gray">()<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> @val <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: red">'gFast'</SPAN><SPAN style="COLOR: gray">;<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> @val<SPAN style="COLOR: gray">;<o:p></o:p></SPAN></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue"><FONT face="Courier New">END<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt"><FONT face="Courier New">GO</FONT></SPAN></P></DIV>
<P mce_keep="true">Create logins, assign function and make changes effective&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <SPAN style="COLOR: blue">LOGIN</SPAN> UserFast <SPAN style="COLOR: blue">WITH</SPAN> PASSWORD = <SPAN style="COLOR: red">'UserFastPwd'</SPAN>, CHECK_POLICY = <SPAN style="COLOR: blue">OFF<o:p></o:p></SPAN></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">CREATE</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <SPAN style="COLOR: blue">LOGIN</SPAN> UserSlow <SPAN style="COLOR: blue">WITH</SPAN> PASSWORD = <SPAN style="COLOR: red">'UserSlowPwd'</SPAN>, CHECK_POLICY = <SPAN style="COLOR: blue">OFF<o:p></o:p></SPAN></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">ALTER</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">GOVERNOR</SPAN> <SPAN style="COLOR: blue">WITH</SPAN> (CLASSIFIER_FUNCTION = dbo.f1)<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">ALTER</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">GOVERNOR</SPAN> <SPAN style="COLOR: blue">RECONFIGURE</SPAN></SPAN></FONT><SPAN style="FONT-SIZE: 5pt; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></P></DIV>
<P mce_keep="true">Add group counters for CPU Usage % and run 1 CPU intensive query UserSlow, then 1 with UserFast. You will observe a picture similar to this:</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//sqlos/2758903.aspx" original-url="https://blogs.technet.com/photos/sqlos/picture2758903.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/6142/00/00/02/75/89/03/blog-group-ctrs-2cpu.PNG" original-url="https://blogs.technet.com/photos/sqlos/images/2758903/original.aspx" border=0></A></P>
<P mce_keep="true">But how can explain that the resource governor does not obey 70:30 distribution we specified for the resource pools? The answer is quite simple: the queries landed on different schedulers (= different CPUs) and thus, there is nothing to share between them and each of them is taking a full CPU. How can you verify that?</P>
<P mce_keep="true">First of all, verify the classification&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: green; mso-bidi-font-size: 16.0pt"><FONT face="Courier New">-- verify the classification<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">select</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sess.session_id, sess.group_id, <SPAN style="COLOR: blue">CONVERT</SPAN>(NCHAR(20), grps.name) <SPAN style="COLOR: blue">as</SPAN> group_name<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">from</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sys.dm_exec_sessions <SPAN style="COLOR: blue">as</SPAN> sess <SPAN style="COLOR: blue">join</SPAN> <o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>sys.dm_resource_governor_workload_groups <SPAN style="COLOR: blue">as</SPAN> grps <SPAN style="COLOR: blue">on</SPAN> sess.group_id = grps.group_id<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">where</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>session_id &gt; 50<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P></DIV>
<P mce_keep="true">Where you will see something like</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">session_id group_id<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>group_name</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">---------- ----------- --------------------</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">52<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>2<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>default<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">51<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>265<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>gSlow<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">54<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>266<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>gFast<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></P></DIV>
<P mce_keep="true">Everything is normal here. Now, let's take a look at how currently executing requests landed on schedulers:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">select</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>r.session_id, <o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">CONVERT</SPAN>(NCHAR(20), wg.name) <SPAN style="COLOR: blue">as</SPAN> group_name, <o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>t.scheduler_id, <o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>r.status<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">from</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> sys.dm_exec_requests r <o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">join</SPAN> sys.dm_os_tasks t <SPAN style="COLOR: blue">on</SPAN> r.task_address = t.task_address<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">join</SPAN> sys.dm_resource_governor_workload_groups wg <SPAN style="COLOR: blue">on</SPAN> r.group_id = wg.group_id<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt">where</SPAN><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"> <o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; mso-bidi-font-size: 16.0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>r.session_id &gt; 50<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; mso-bidi-font-size: 16.0pt"><FONT face="Courier New">GO</FONT></SPAN><SPAN style="FONT-SIZE: 5pt; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></P></DIV>
<P mce_keep="true">Which will get</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">session_id group_name<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>scheduler_id status</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">---------- -------------------- ------------ ------------------------------</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">54<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="BACKGROUND: yellow; mso-highlight: yellow">gFast<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>0</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>runnable</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">52<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>default<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>0<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>running</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">51<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="BACKGROUND: yellow; mso-highlight: yellow">gSlow<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>1</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>running</FONT></P></DIV>
<P mce_keep="true">What you can see here is that gFast and gSlow is working on different schedulers, thus confirming our earlier statement. Thus Red and Blue line corresponds to utilization of 1 full CPU or 50%, since it is normalized to number of CPUs available on the box.</P>
<P mce_keep="true">Is this a problem with Resource Governor in general? Certainly not if you have more executing requests than you have CPUs or if queries are running in parallel. But you should keep this in mind if you are trying to give 90% of CPU bandwidth to a single query running serially compared to a parallel query or number of serial queries in another group/pool. </P>
<P mce_keep="true">A simple way of thinking about this is: is my workload capable of taking as much CPU as I told it to? Remember, when you set MAX_CPU_PERCENT on the pool, you allowing workloads belonging to the pool to take this much bandwidth on each scheduler. In case of the demo, you are working with a single query workload which produces this initially unexpected result.&nbsp;&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Part 1: Anatomy of SQL Server 2008 Resource Governor CPU Demo</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlos/part-1-anatomy-of-sql-server-2008-resource-governor-cpu-demo</link>
      <pubDate>Fri, 14 Dec 2007 15:19:00 GMT</pubDate>
      <dc:creator><![CDATA[BorisB]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sqlos/2007/12/14/part-1-anatomy-of-sql-server-2008-resource-governor-cpu-demo/</guid>
      <description><![CDATA[First, a quick introduction. My name is Boris Baryshnikov and I'm a program manager in SQL Server...]]></description>
      <content:encoded><![CDATA[First, a quick introduction. My name is Boris Baryshnikov and I'm a program manager in SQL Server Database Engine group. As of today, Resource Governor is the most recent large project I worked on. Not surprisingly, I will talk about the Resource Governor here. 
<P>While Resource Governor spans multiple components of SQL Server Engine, it seems logical to discuss the feature in this blog as the resource management in general is so close to the scope of SQLOS. </P>
<P>Without further delay, let's get to point. As we have recently released a public CTP (Community Technology Preview) of SQL Server 2008 (aka <A class="" href="https://www.microsoft.com/downloads/details.aspx?FamilyID=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&amp;displaylang=en" target=_blank mce_href="https://www.microsoft.com/downloads/details.aspx?FamilyID=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&amp;displaylang=en">SQL Server 2008 November CTP</A>), which has Resource Governor functionality, and a number of presentations with Resource Governor demo on various conferences, I started getting a lot of questions about the demo itself which made me write this post. </P>
<P>We created this demo when Resource Governor was only a prototype to illustrate the concept, but probably its simplicity made it so attractive that it was included in a number of talks and demos by different people all over the world.</P>
<H5>Background</H5>
<P>If you are looking for general concepts about Resource Governor, check out the Books Online which comes as a <A class="" href="https://www.microsoft.com/downloads/details.aspx?familyid=19DB0B42-A5B2-456F-9C5C-F295CDD58D7A&amp;displaylang=en" target=_blank mce_href="https://www.microsoft.com/downloads/details.aspx?familyid=19DB0B42-A5B2-456F-9C5C-F295CDD58D7A&amp;displaylang=en">separate download</A> or <A class="" href="https://msdn2.microsoft.com/en-us/library/bb933866(SQL.100).aspx" target=_blank mce_href="https://msdn2.microsoft.com/en-us/library/bb933866(SQL.100).aspx">read it directly on MSDN Library</A>. </P>
<H5>The Demo in a Nutshell</H5>
<P>In the demo we will create two workload groups which share a common resource pool and one workload group which has its own dedicated resource pool. Each group gets a CPU intensive workload. Using the Resource Governor you will be able to affect CPU distribution between these competing workloads. The effects of the resource management are observed using performance counters specific to Resource Governor.</P>
<H5>Step 1: Initial Demo Setup</H5>
<P mce_keep="true">On a newly installed server (i.e. no prior Resource Governor configuration) you may need to run these setup steps. I normally doing my demo on a dual core laptop and for the sake of simplicity I'm using a single CPU for SQL Server. To do so, I adjust CPU affinity mask as follows:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New" color=#008000>-- first enable advanced options in sp_configure</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">sp_configure <SPAN style="COLOR: red">'show advanced'</SPAN>, 1</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">RECONFIGURE<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New" color=#008000>-- use only 1 CPU on demo machine</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">sp_configure <SPAN style="COLOR: red">'affinity mask'</SPAN>, 1</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">RECONFIGURE<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><o:p>&nbsp;</o:p></P>
<P mce_keep="true">Using 1 CPU for SQL Server on a dual proc machine has an interesting side-effect: we normalize "CPU usage %" counter to number of CPUs on the box and thus, the values will hover around 50% as maximum and not 100% as you might expect. I will illustrate this below.</P>
<P>Of course you can use both CPUs but this complicates the demo. This is a subject for whole another post - what happens when you have multiple CPUs. </P>
<P>In addition to that for demo purposes I will set min/max server memory to a fixed value, since it will improve predictability of the demo on the laptop.</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: green"><FONT face="Courier New">-- 512 Mb is suitable for laptop demo<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">sp_configure <SPAN style="COLOR: red">'min server'</SPAN>, 512</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><FONT face="Courier New">sp_configure <SPAN style="COLOR: red">'max server'</SPAN>, 512</FONT></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: blue"><FONT face="Courier New">RECONFIGURE<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="BACKGROUND: #f2f2f2; MARGIN: 0in 0in 0pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: blue"><FONT face="Courier New">GO</FONT></SPAN></P></DIV>
<H5>Step 2: Workload groups and Resource Pools</H5>
<P mce_keep="true">Now we will be setting up the following hierarchy of workload groups and resource pools:</P>
<P mce_keep="true"><IMG title="Resource Governor Group and Pool hierarchy" style="WIDTH: 476px; HEIGHT: 178px" height=178 alt="Resource Governor Group and Pool hierarchy" src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-pool-hierarchy.png" width=476 mce_src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-pool-hierarchy.png"></P>
<P>Each corresponding workload group contains queries of the corresponding class or department (i.e. Marketing, Adhoc, and VP). Note that, Marketing and Adhoc queries share the same resource pool, while workload group VP has its own similarly named pool. The reason of such separation will become clear as we see how we adjust Resource Governor controls.</P>
<P>You will start building the above configuration in a bottom up manner (i.e. starting from pools and going up)</P>
<P>To do so, we execute the following T-SQL: </P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green; mso-bidi-font-size: 8.0pt"><FONT face="Courier New">-- create user pools<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green; mso-bidi-font-size: 8.0pt"><FONT face="Courier New">-- note that we are using all default parameters<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">CREATE</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">POOL</SPAN> PoolMarketingAdhoc<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">CREATE</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">POOL</SPAN> PoolVP<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="mso-bidi-font-size: 8.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green; mso-bidi-font-size: 8.0pt"><FONT face="Courier New">-- create user groups<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green; mso-bidi-font-size: 8.0pt"><FONT face="Courier New">-- also note that all groups created with default parameters<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green; mso-bidi-font-size: 8.0pt"><FONT face="Courier New">-- only pointing to the corresponding pools (and not 'default')<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">CREATE</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> <SPAN style="COLOR: blue">WORKLOAD</SPAN> <SPAN style="COLOR: blue">GROUP</SPAN> GroupMarketing<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">USING</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> PoolMarketingAdhoc<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="mso-bidi-font-size: 8.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">CREATE</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> <SPAN style="COLOR: blue">WORKLOAD</SPAN> <SPAN style="COLOR: blue">GROUP</SPAN> GroupAdhoc<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">USING</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> PoolMarketingAdhoc<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="mso-bidi-font-size: 8.0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">CREATE</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> <SPAN style="COLOR: blue">WORKLOAD</SPAN> <SPAN style="COLOR: blue">GROUP</SPAN> GroupVP<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt">USING</SPAN><SPAN style="mso-bidi-font-size: 8.0pt"> PoolVP<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue; mso-bidi-font-size: 8.0pt"><FONT face="Courier New">GO</FONT></SPAN><SPAN style="mso-bidi-font-size: 8.0pt"><o:p></o:p></SPAN></P></DIV>
<H5>Step 3: Classification</H5>
<P>Now, what you have just done is created hierarchy of the groups and pools, however, how does the server know about which query goes where? This is where classification comes in. The above picture becomes:</P>
<P><IMG title="Group and Pool hierarchy with classification" style="WIDTH: 489px; HEIGHT: 418px" height=418 alt="Group and Pool hierarchy with classification" src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-pool-class.png" width=489 mce_src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-pool-class.png"></P>
<P mce_keep="true">There is a couple of things:</P>
<OL>
<LI>To do the classification you will need to create a user-defined function that will be executed for every new connection and it will place these new connections in the corresponding workload groups.</LI>
<LI>How will we separate different connections? For demo purposes we will use 3 separate login names which we will check and use inside of the function</LI></OL>
<P mce_keep="true">To implement the above 2 steps we will run the following:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- classifier function should be created in master database<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- switch to master unless you are there already<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">USE</SPAN> <SPAN style="COLOR: blue">master<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- create logins to separate users into different groups<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- note that we disabled strong password checking for demo purposes<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- but this is against any best practice<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">CREATE</SPAN> <SPAN style="COLOR: blue">LOGIN</SPAN> UserMarketing <SPAN style="COLOR: blue">WITH</SPAN> PASSWORD = <SPAN style="COLOR: red">'UserMarketingPwd'</SPAN>, CHECK_POLICY = <SPAN style="COLOR: blue">OFF<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">CREATE</SPAN> <SPAN style="COLOR: blue">LOGIN</SPAN> UserAdhoc <SPAN style="COLOR: blue">WITH</SPAN> PASSWORD = <SPAN style="COLOR: red">'UserAdhocPwd'</SPAN>, CHECK_POLICY = <SPAN style="COLOR: blue">OFF<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">CREATE</SPAN> <SPAN style="COLOR: blue">LOGIN</SPAN> UserVP <SPAN style="COLOR: blue">WITH</SPAN> PASSWORD = <SPAN style="COLOR: red">'UserVPPwd'</SPAN>, CHECK_POLICY = <SPAN style="COLOR: blue">OFF<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- now create the classifier function<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">IF</SPAN> OBJECT_ID(<SPAN style="COLOR: red">'DBO.CLASSIFIER_V1'</SPAN>,<SPAN style="COLOR: red">'FN'</SPAN>) <SPAN style="COLOR: blue">IS</SPAN> <SPAN style="COLOR: blue">NOT</SPAN> <SPAN style="COLOR: blue">NULL<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DROP</SPAN> <SPAN style="COLOR: blue">FUNCTION</SPAN> DBO.CLASSIFIER_V1</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- note that this is just a regular function <o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">CREATE</SPAN> <SPAN style="COLOR: blue">FUNCTION</SPAN> CLASSIFIER_V1 ()</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">RETURNS SYSNAME <SPAN style="COLOR: blue">WITH</SPAN> SCHEMABINDING</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">BEGIN<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">DECLARE</SPAN> @val varchar(32)</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> @val = <SPAN style="COLOR: red">'default'</SPAN>;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: red">'UserVP'</SPAN> = SUSER_SNAME() </FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> @val = <SPAN style="COLOR: red">'GroupVP'</SPAN>;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">else</SPAN> <SPAN style="COLOR: blue">if</SPAN> <SPAN style="COLOR: red">'UserMarketing'</SPAN> = SUSER_SNAME()</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> @val = <SPAN style="COLOR: red">'GroupMarketing'</SPAN>;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">else</SPAN> <SPAN style="COLOR: blue">if</SPAN> <SPAN style="COLOR: red">'UserAdhoc'</SPAN> = SUSER_SNAME()</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">SET</SPAN> @val = <SPAN style="COLOR: red">'GroupAdhoc'</SPAN>;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> @val;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">END<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P></DIV>
<H5>Step 4: Are we there yet?</H5>
<P>After all this work, can we start workloads and see what happens? The answer, as you have guessed by the question is - no. What's left? Again, a couple of steps:</P>
<OL>
<LI>We need to tell Resource Governor to use the function that we just created</LI>
<LI>Make all the changes effective</LI></OL>
<P>First step is done by </P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242"><SPAN style="COLOR: green"><FONT face="Courier New">-- make function known to the Resource Governor<o:p></o:p></FONT></SPAN> 
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">GOVERNOR</SPAN> </FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">WITH</SPAN> (CLASSIFIER_FUNCTION = dbo.CLASSIFIER_V1)</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO</FONT></SPAN><SPAN style="FONT-SIZE: 1pt; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></P></DIV>
<P mce_keep="true">For the second step, let's compare output of catalog views with in-memory information (note difference in names of catalog views and dynamic management views (DMVs) which are prefixed with dm_:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- metadata information<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">SELECT</SPAN> * <SPAN style="COLOR: blue">FROM</SPAN> sys.resource_governor_workload_groups</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">SELECT</SPAN> * <SPAN style="COLOR: blue">FROM</SPAN> sys.resource_governor_resource_pools</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">SELECT</SPAN> * <SPAN style="COLOR: blue">FROM</SPAN> sys.resource_governor_configuration</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- in-memory information<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">SELECT</SPAN> * <SPAN style="COLOR: blue">FROM</SPAN> sys.<SPAN style="BACKGROUND: yellow; mso-highlight: yellow">dm_</SPAN>resource_governor_workload_groups</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">SELECT</SPAN> * <SPAN style="COLOR: blue">FROM</SPAN> sys.<SPAN style="BACKGROUND: yellow; mso-highlight: yellow">dm_</SPAN>resource_governor_resource_pools</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">SELECT</SPAN> * <SPAN style="COLOR: blue">FROM</SPAN> sys.<SPAN style="BACKGROUND: yellow; mso-highlight: yellow">dm_</SPAN>resource_governor_configuration</FONT></P></DIV>
<P mce_keep="true">Now transfer changes from metadata to memory by running the following statement. Also, do not confuse it with already existing RECONFIGURE command:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- make the changes effective<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">GOVERNOR</SPAN> <SPAN style="COLOR: blue">RECONFIGURE<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">GO<o:p></o:p></FONT></SPAN></P></DIV>
<P mce_keep="true">And rerun the above query on metadata and DMVs and you should see that new groups, pools and classifier function ID are present in corresponding DMVs.</P>
<H5>Step 5: Running the workloads</H5>
<P>The easiest way to simulate a CPU intensive workload is to run the following in a loop:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">set</SPAN> nocount <SPAN style="COLOR: blue">on<o:p></o:p></SPAN></FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">declare</SPAN> @i int</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">declare</SPAN> @s varchar(100)</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">set</SPAN> @i = 100000000</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">while</SPAN> @i &gt; 0 </FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">begin<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">select</SPAN> @s = <SPAN style="COLOR: blue">@@version</SPAN>;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">set</SPAN> @i = @i - 1;</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><FONT face="Courier New">end</FONT></SPAN><SPAN style="FONT-SIZE: 1pt; mso-bidi-font-size: 16.0pt"><o:p></o:p></SPAN></P></DIV>
<P mce_keep="true">Also, instead of running this query from the Management Studio, consider saving it in a file and running from a command prompt by using a script similar to the below. Note that we are using 3 different user names to connect to the server.</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">echo "Press any key to start Marketing workload"</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">pausestart sqlcmd -S <I style="mso-bidi-font-style: normal">&lt;your_server_name&gt;</I> -U <B style="mso-bidi-font-weight: normal"><SPAN style="BACKGROUND: black; COLOR: white; mso-themecolor: background1; mso-shading-themecolor: text1">UserMarketing</SPAN></B> -P UserMarketingPwd -i "CPU intensive loop.sql"</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">echo "Press any key to start VP workload"</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">pause</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">start sqlcmd -S <I style="mso-bidi-font-style: normal">&lt;your_server_name&gt;</I> -U <B style="mso-bidi-font-weight: normal"><SPAN style="BACKGROUND: black; COLOR: white; mso-themecolor: background1; mso-shading-themecolor: text1">UserVP</SPAN></B> -P UserVPPwd -i "CPU intensive loop.sql"</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">echo "Press any key to start Adhoc workload"</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">pause</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New">start sqlcmd -S <I style="mso-bidi-font-style: normal">&lt;your_server_name&gt;"</I> -U <B style="mso-bidi-font-weight: normal"><SPAN style="BACKGROUND: black; COLOR: white; mso-themecolor: background1; mso-shading-themecolor: text1">UserAdhoc</SPAN></B> -P UserAdhocPwd -i "CPU intensive loop.sql"</FONT></P></DIV>
<P>To observe the effects of the load, add the following performance counters in the perfmon:</P>
<OL>
<LI>We will monitor CPU usage per group in the 1<SUP>st</SUP> instance of perfmon; add "SQLServer:Workload Group Stats object", "CPU usage %" counter for "GroupMarketing", "GroupAdhoc" and "GroupVP" instances</LI>
<LI>We will monitor CPU usage per pool 2<SUP>nd</SUP> instance of perfmon, add "SQLServer:Resource Pool Stats object", "CPU usage %" counter for "PoolMarketingAdhoc" and "GroupVP" instances</LI></OL>
<P>Before you start the next workload, observe the counters for pools and groups for a number of seconds, you should see approximately the following:</P>
<P mce_keep="true">For groups (click on the image to open in a new window):</P>
<P mce_keep="true"><A class="" href="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-1.png" target=_blank mce_href="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-1.png"><IMG title="CPU usage % counters for groups" style="WIDTH: 473px; HEIGHT: 600px" height=600 alt="CPU usage % counters for groups" src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-1-sm.png" width=473 mce_src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-1-sm.png"></A></P>
<P>For pools:</P>
<P mce_keep="true"><A class="" href="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-1.png" target=_blank mce_href="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-1.png"><IMG title="CPU usage % for pools" style="WIDTH: 483px; HEIGHT: 600px" height=600 alt="CPU usage % for pools" src="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-1-sm.png" width=483 mce_src="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-1-sm.png"></A></P>
<P>Few things to note:</P>
<OL>
<LI>Remember I set affinity mask to 1? This is why the maximum on the figures is only 50% (it is for a single CPU while usage is normalized to all CPUs on the machine, 2 in my case)</LI>
<LI>At point A, I started Marketing workload, CPU usage went to the maximum on the CPU for a single workload, 50% in this case</LI>
<LI>At point B, I started VP workload, which, as you remember, belongs to a separate resource pool and it made Marketing group share half of the CPU with VP group. The same is true for the pools (because we have 1 to 1 match of active requests in groups to pools at this point)</LI>
<LI>At point C, I started Adhoc workload, which has its own group but shares the pool with Marketing workload. What happened here on the groups is that all 3 of them are now sharing the CPU getting approximately 1/3 of it or roughly 17%. On the pool side, however, we can see that MarketingAdhoc pool which shows aggregate resource usage by all groups inside of it, has 2/3 or the CPU while PoolVP has only 1/3. This behavior is exactly what you get on SQL Server 2005. Resources are distributed as they are being requested and whoever needs more CPU simply gets it. This was one of the goals: to make behavior as close as possible to SQL Server 2005 when you do not use the Resource Governor or adjust any parameters of it. Note, however, by creating the groups and pools you are already slightly altering the behavior of SQL Server 2008, but more on this in the next few posts.</LI></OL>
<H5>Step 6: Management Actions</H5>
<P>Now we came to the point where we want to apply action to change the above picture. Specifically, we want our VP workload to proceed faster and thus, limit CPU usage by Marketing and Adhoc workloads to 50% of the CPU.</P>
<P>To do this, we alter the PoolMarketingAdhoc using the following syntax (remember, we created the pool using all default parameters):</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- adjust PoolMarketingAdhoc to not consume more than 50% of CPU<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">POOL</SPAN> PoolMarketingAdhoc</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">WITH</SPAN> (MAX_CPU_PERCENT = 50)</FONT></P></DIV>
<P mce_keep="true">Remember to make changes effective:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- make the changes effective<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">GOVERNOR</SPAN> <SPAN style="COLOR: blue">RECONFIGURE<o:p></o:p></SPAN></FONT></P></DIV>
<P mce_keep="true">Now, let's look at the counters:</P>
<P>For groups:</P>
<P mce_keep="true"><A class="" href="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-1.png" target=_blank mce_href="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-1.png"><IMG title="CPU usage % for groups after management actions" style="WIDTH: 500px; HEIGHT: 330px" height=330 alt="CPU usage % for groups after management actions" src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-2-sm.png" width=500 mce_src="https://www.hobby4ever.com/sqlos_blog_images/blog-group-ctrs-2-sm.png"></A></P>
<P>For pools:</P>
<P><A class="" href="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-2.png" target=_blank mce_href="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-2.png"><IMG title="CPU usage % for pools after management actions" style="WIDTH: 500px; HEIGHT: 323px" height=323 alt="CPU usage % for pools after management actions" src="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-2-sm.png" width=500 mce_src="https://www.hobby4ever.com/sqlos_blog_images/blog-pool-ctrs-2-sm.png"></A></P>
<P>What you will see is what happened at point D: Pool usage by PoolMarketingAdhoc went back to half of the CPU while PoolVP took the remaining part of it. Note that, on group side GroupVP usage went up to use half of the CPU (it has a single workload) while groups Marketing and Adhoc divide another half equally (12.5% each).</P>
<P mce_keep="true">Further step is to alter IMPORTANCE parameters of the Marketing and Adhoc groups. IMPORTANCE affects CPU distribution when two groups share the same pool. Value of importance has a numeric meaning for CPU bandwidth distribution. Ratio of Low:Medium:High IMPORTANCE is equal to 1:3:9.</P>
<P>To illustrate this, let's run the following:</P>
<DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #f2f2f2; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242">
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- alter importance of adhoc group<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">WORKLOAD</SPAN> <SPAN style="COLOR: blue">GROUP</SPAN> GroupAdhoc </FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">WITH</SPAN> (IMPORTANCE = Low)</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- alter importance of marketing group<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">WORKLOAD</SPAN> <SPAN style="COLOR: blue">GROUP</SPAN> GroupMarketing</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">WITH</SPAN> (IMPORTANCE = High)</FONT></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: green"><FONT face="Courier New">-- make the changes effective<o:p></o:p></FONT></SPAN></P>
<P class=T-SQL style="MARGIN: 0in 0in 0pt"><FONT face="Courier New"><SPAN style="COLOR: blue">ALTER</SPAN> <SPAN style="COLOR: blue">RESOURCE</SPAN> <SPAN style="COLOR: blue">GOVERNOR</SPAN> <SPAN style="COLOR: blue">RECONFIGURE<o:p></o:p></SPAN></FONT></P></DIV>
<P mce_keep="true">When changes become effective corresponds to the point E on the above graphs. Note that distribution between pools does not change, amount of CPU available to GroupVP also does not change (there are no other groups in this pool), but GroupMarketing takes about 10 times of the bandwidth available to GroupAdhoc (remember the ratio of Low:High = 1:9, but together they stay within PoolMarketingAdhoc limits.</P>
<P mce_keep="true">&nbsp;</P>
<P>That's enough for the first post. In the upcoming post I will try to go over the cases when the demo does not seem to work or shows "unusual" behavior and possible explanations of it.</P>]]></content:encoded>
    </item>
  </channel>
</rss>