<?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>Joe Sack's SQL Server Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/joesack/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/joesack/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:23:24 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Until we meet again...</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/until-we-meet-again</link>
      <pubDate>Fri, 30 Sep 2011 07:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/09/30/until-we-meet-again/</guid>
      <description><![CDATA[Today is my last day with Microsoft.&nbsp; After five and a half years, I recently decided to join...]]></description>
      <content:encoded><![CDATA[<p>Today is my last day with Microsoft.&nbsp; After five and a half years, I recently decided to join SQLskills as "Employee #4".&nbsp;</p>
<p>Microsoft has been very good to me over the years and I'm grateful for the friendships made and the significant memories.&nbsp;</p>
<p>For the longer story of my move&nbsp;- I'll be posting soon to <a title="https://www.sqlskills.com/blogs/joe/" href="https://www.sqlskills.com/blogs/joe/" target="_blank">my new blog over at SQLskills.com</a>.&nbsp; Very honored to be joining&nbsp;Kimberly, Paul and Jonathan.&nbsp; I'll be getting back to consulting, writing and mentoring.&nbsp; Paul and Kimberly already have clients lined up for me next Monday, so needless to say I'm really excited to start.</p>
<p>Until we meet again!</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Announcing the new SQL MCM Program Manager</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/announcing-the-new-sql-mcm-program-manager</link>
      <pubDate>Mon, 27 Jun 2011 19:48:03 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/06/27/announcing-the-new-sql-mcm-program-manager/</guid>
      <description><![CDATA[I&rsquo;ve been waiting for a long running transaction to commit, so to speak, before announcing the...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">I&rsquo;ve been waiting for a long running transaction to commit, so to speak, before announcing the big news&hellip;</span></p>
<p><span style="font-size: small;">I am truly happy to announce that Microsoft Learning has hired a new SQL MCM Program Manager to keep moving forward with our recent program changes and continue to expand the program&rsquo;s value and impact: &nbsp;</span></p>
<p><span style="font-size: small;"><b>Robert Davis</b> (<a href="https://www.sqlsoldier.com/wp/" target="_blank"><span style="color: #0000ff;" color="#0000ff">blog</span></a> | <a href="https://twitter.com/#!/SQLSoldier" target="_blank"><span style="color: #0000ff;" color="#0000ff">twitter</span></a> | <a href="https://www.linkedin.com/in/robertldavis" target="_blank"><span style="color: #0000ff;" color="#0000ff">linkedin</span></a>) is the new SQL Server Microsoft Certified Master Program Manager!</span></p>
<p><span style="font-size: small;">There are <i>many </i>reasons why I&rsquo;m happy about this hiring decision, but I&rsquo;ll stick with my top three reasons here:</span></p>
<ol>
<li><span style="font-size: small;">Robert is an active and tireless community contributor, author and speaker.&nbsp; His community interactions are frequent, consistent and high quality.&nbsp; I also appreciate that he helps people on both internal Microsoft and external facing forums.&nbsp;</span></li>
<li><span style="font-size: small;">He is a Microsoft Certified Master with a deep understanding of the program scope (depth and breadth).&nbsp; He also understands that while the program is elite <i>it should not be elitist</i>.&nbsp; As I&rsquo;ve said several times before, there are many &ldquo;uncertified masters&rdquo; out there and the program has only just started to reach them.</span></li>
<li><span style="font-size: small;">Robert is also incredibly responsive and focused on taking care of the community and ensuring that people&rsquo;s hard-earned efforts are recognized and appreciated.&nbsp;&nbsp;</span></li>
</ol>
<p><span style="font-size: small;">I think Robert will take things well beyond where I left them and I&rsquo;m looking forward to seeing all the great things that I know he will do. &nbsp;</span></p>
<p><span style="font-size: small;">Now &ndash; where did I go off to?&nbsp;</span></p>
<p><span style="font-size: small;">I actually transitioned to my new role a few weeks ago.&nbsp; I was a SQL Server support engineer for the last 4 &frac12; years with the Microsoft Premier Field Engineering team and I also served the dual role of acting SQL MCM Program Manager for the last two years.&nbsp;</span></p>
<p><span style="font-size: small;">The time was right for a big change and so I&rsquo;ve joined the SQL Server Content &amp; Community team in a Program Manager role.&nbsp; While there are several aspects of the position still in motion &ndash; I will start off in this role by working on various aspects of Microsoft&rsquo;s SQL Server content strategy.&nbsp; I&rsquo;ll also be involved in planning and driving the next wave of content for the upcoming release of SQL Server.&nbsp; &nbsp;&nbsp;</span></p>
<p><span style="font-size: small;">This is definitely a behind-the-scenes role and that suits me well. I do hope to blog at my same infrequent pace &ndash; but we&rsquo;ll see. &nbsp;While this role gets away from support and far more into the PM space, I&rsquo;ll still be digging in to some technical details as part of my new role (already encountered a very interesting scenario that will be fun to blog about when the time is right).&nbsp; So if something warrants comment I&rsquo;ll try to share.&nbsp; Or I may ask others to share instead and this blog will become even dustier.&nbsp; We&rsquo;ll see&hellip;</span></p>
<p><span style="font-size: small;">In the meantime, onward we go &ndash; and please join me in welcoming Robert Davis to his new role!&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Measuring impact of “optimize for ad hoc workloads” via CACHESTORE_SQLCP</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/measuring-impact-of-optimize-for-ad-hoc-workloads-via-cachestore_sqlcp</link>
      <pubDate>Mon, 28 Mar 2011 08:39:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/03/28/measuring-impact-of-optimize-for-ad-hoc-workloads-via-cachestore_sqlcp/</guid>
      <description><![CDATA[The cache store &ldquo;CACHESTORE_SQLCP&rdquo; represents cached ad-hoc query plans, server-side...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;">The cache store &ldquo;CACHESTORE_SQLCP&rdquo; represents cached ad-hoc query plans, server-side cursors and prepared statements.<span style="mso-spacerun: yes;">&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;</span>One way to gather memory allocation values for this specific cache store is by using the following query:<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> single_pages_kb<span style="color: gray;">,</span> multi_pages_kb<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: green;">sys</span><span style="color: gray;">.</span><span style="color: green;">dm_os_memory_clerks<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHERE</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">type</span> <span style="color: gray;">=</span> <span style="color: red;">'CACHESTORE_SQLCP'<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;">You can also see allocations to CACHESTORE_SQLCP via DBCC MEMORYSTATUS (example output below for one node):<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">CACHESTORE_SQLCP (node 0),KB<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">VM Reserved,0<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">VM Committed,0<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">Locked Pages Allocated,0<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">SM Reserved,0<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">SM Committed,0<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">SinglePage Allocator,12728<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">MultiPage Allocator,1968<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri; font-size: small;">There has already been much written about cache bloat due to ad hoc query plans and I won&rsquo;t rehash it here (Kimberly Tripp has a few great posts on this topic &ndash; </span><a target="_blank" href="https://www.sqlskills.com/blogs/kimberly/post/procedure-cache-and-optimizing-for-adhoc-workloads.aspx"><span style="font-family: Calibri; font-size: small;">including one post that lists several posts from different authors</span></a><span style="font-family: Calibri; font-size: small;"> on the subject).<span style="mso-spacerun: yes;">&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;</span>There are multiple ways to reduce this bloat (for example - move to using parameterized queries, force parameterization).<span style="mso-spacerun: yes;">&nbsp; </span>One of the easier methods includes enabling the &ldquo;</span><a target="_blank" href="https://msdn.microsoft.com/en-us/library/cc645587.aspx"><span style="font-family: Calibri; font-size: small;">optimize for ad hoc workloads</span></a><span style="font-size: small;"><span style="font-family: Calibri;">&rdquo; option.<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri; font-size: small;">The purpose of this post is to connect the dots between CACHESTORE_SQLCP and enabling the &ldquo;</span><span style="font-family: Calibri; font-size: small;">optimize for ad hoc workloads</span><span style="font-size: small;"><span style="font-family: Calibri;">" option (note that you can also use sys.dm_exec_cached_plans to see the impact on size_in_bytes by plan and reference the cacheobjtype of Compiled Plan versus Compiled Plan Stub).<span style="mso-spacerun: yes;">&nbsp; </span>The following demonstration simply shows the impact of executing several ad hoc queries and measuring the significant allocation differences in CACHESTORE_SQLCP.&nbsp; In my&nbsp;testing &ndash; single_pages_kb was equal to 13,072 without plan stubs and then 760 after enabling the &ldquo;optimize for&hellip;&rdquo; option.&nbsp;This below demo is intended to be stepped through statement by statement:<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Tested on 10.50.1765<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- This demo assumes optimize for ad hoc workloads is off<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- (And yes please only run this demo on a test environment)<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">USE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> [master]<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: 'Courier New'; font-size: 10pt; 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="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">RECONFIGURE<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: maroon;">sp_configure</span><span style="color: blue;"> </span><span style="color: red;">'optimize for ad hoc workloads'</span><span style="color: gray;">,</span>0<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">RECONFIGURE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: 'Courier New'; font-size: 10pt; 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>0<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">RECONFIGURE<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">CREATE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">DATABASE</span> [QueryBloat]<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">USE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> [QueryBloat]<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">CREATE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">TABLE</span> dbo<span style="color: gray;">.</span>Bloat<span style="color: blue;"> </span><span style="color: gray;">(</span>col01 <span style="color: blue;">uniqueidentifier</span><span style="color: gray;">);<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">INSERT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> dbo<span style="color: gray;">.</span>Bloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">VALUES </span><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; color: fuchsia; font-size: 10pt; mso-no-proof: yes;">NEWID</span><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;">())<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> 500<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Clear out adhoc queries, prior to baseline<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DBCC</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> FREESYSTEMCACHE<span style="color: gray;">(</span><span style="color: red;">'SQL Plans'</span><span style="color: gray;">)</span> <o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Take baseline <o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> single_pages_kb<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: green;">sys</span><span style="color: gray;">.</span><span style="color: green;">dm_os_memory_clerks<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHERE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">type</span> <span style="color: gray;">=</span> <span style="color: red;">'CACHESTORE_SQLCP'<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- In my case, I saw single_pages_kb = 120<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Now let's make some bloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> @NEWID <span style="color: blue;">varchar</span><span style="color: gray;">(</span>36<span style="color: gray;">)<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat <span style="color: blue;">CURSOR</span> <span style="color: blue;">FOR</span><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> col01<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> dbo<span style="color: gray;">.</span>Bloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">ORDER</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">BY</span> col01<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">OPEN</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FETCH</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">NEXT</span> <span style="color: blue;">FROM</span> curBloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">INTO</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> @NEWID<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC </span><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;">'SELECT col01 FROM dbo.Bloat WHERE col01 = '</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: gray;">+</span> <span style="color: red;">''''</span> <span style="color: gray;">+</span> @NEWID <span style="color: gray;">+</span> <span style="color: red;">''''</span><span style="color: gray;">)<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHILE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: fuchsia;">@@FETCH_STATUS</span> <span style="color: gray;">=</span> 0<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">BEGIN<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FETCH</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">NEXT</span> <span style="color: blue;">FROM</span> curBloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">INTO</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> @NEWID<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC </span><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;">'SELECT col01 FROM dbo.Bloat WHERE col01 = '</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: gray;">+</span> <span style="color: red;">''''</span> <span style="color: gray;">+</span> @NEWID <span style="color: gray;">+</span> <span style="color: red;">''''</span><span style="color: gray;">)<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">END<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">CLOSE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DEALLOCATE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Checking again, I see single_pages_kb = 13,072<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> single_pages_kb<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: green;">sys</span><span style="color: gray;">.</span><span style="color: green;">dm_os_memory_clerks<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHERE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">type</span> <span style="color: gray;">=</span> <span style="color: red;">'CACHESTORE_SQLCP'<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Now let's enable "optimize for ad hoc workloads"<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: 'Courier New'; font-size: 10pt; 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="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">RECONFIGURE<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: maroon;">sp_configure</span><span style="color: blue;"> </span><span style="color: red;">'optimize for ad hoc workloads'</span><span style="color: gray;">,</span>1<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">RECONFIGURE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC</span><span style="font-family: 'Courier New'; font-size: 10pt; 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>0<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">RECONFIGURE<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">GO<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Clear out adhoc queries for our second test<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DBCC</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> FREESYSTEMCACHE<span style="color: gray;">(</span><span style="color: red;">'SQL Plans'</span><span style="color: gray;">)</span> <o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Take baseline - I see single_pages_kb = 120<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> single_pages_kb<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: green;">sys</span><span style="color: gray;">.</span><span style="color: green;">dm_os_memory_clerks<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHERE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">type</span> <span style="color: gray;">=</span> <span style="color: red;">'CACHESTORE_SQLCP'<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Make some bloat again<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> @NEWID <span style="color: blue;">varchar</span><span style="color: gray;">(</span>36<span style="color: gray;">)<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat <span style="color: blue;">CURSOR</span> <span style="color: blue;">FOR</span><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> col01<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> dbo<span style="color: gray;">.</span>Bloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">ORDER</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">BY</span> col01<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">OPEN</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FETCH</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">NEXT</span> <span style="color: blue;">FROM</span> curBloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">INTO</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> @NEWID<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC </span><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;">'SELECT col01 FROM dbo.Bloat WHERE col01 = '</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: gray;">+</span> <span style="color: red;">''''</span> <span style="color: gray;">+</span> @NEWID <span style="color: gray;">+</span> <span style="color: red;">''''</span><span style="color: gray;">)<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHILE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: fuchsia;">@@FETCH_STATUS</span> <span style="color: gray;">=</span> 0<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">BEGIN<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FETCH</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">NEXT</span> <span style="color: blue;">FROM</span> curBloat<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">INTO</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> @NEWID<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">EXEC </span><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; color: red; font-size: 10pt; mso-no-proof: yes;">'SELECT col01 FROM dbo.Bloat WHERE col01 = '</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: gray;">+</span> <span style="color: red;">''''</span> <span style="color: gray;">+</span> @NEWID <span style="color: gray;">+</span> <span style="color: red;">''''</span><span style="color: gray;">)<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">END<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">CLOSE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">DEALLOCATE</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> curBloat<span style="color: gray;">;<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: gray; font-size: 10pt; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: green; font-size: 10pt; mso-no-proof: yes;">-- Measuring impact - single_pages_kb = 760 (versus 13,072)<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> single_pages_kb<o:p></o:p></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: green;">sys</span><span style="color: gray;">.</span><span style="color: green;">dm_os_memory_clerks<o:p></o:p></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;">WHERE</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt; mso-no-proof: yes;"> <span style="color: blue;">type</span> <span style="color: gray;">=</span> <span style="color: red;">'CACHESTORE_SQLCP'</span></span><o:p></o:p></p>]]></content:encoded>
    </item>
    <item>
      <title>ARP Caching and SQL Server Failover Cluster install failures</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/arp-caching-and-sql-server-failover-cluster-install-failures</link>
      <pubDate>Sun, 27 Mar 2011 13:42:10 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/03/27/arp-caching-and-sql-server-failover-cluster-install-failures/</guid>
      <description><![CDATA[Now I&rsquo;m definitely not a networking guy, so even the more basic networking concepts fill me...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';">Now I&rsquo;m definitely <i style="mso-bidi-font-style: normal;">not</i> a networking guy, so even the more basic networking concepts fill me with wonder. <span style="mso-spacerun: yes;">&nbsp;</span>One area I learned about recently with regards to the following scenario was related to <a target="_blank" href="https://en.wikipedia.org/wiki/Address_Resolution_Protocol">Address Resolution Protocol</a> (ARP) caching.<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';">Consider the following scenario&hellip; You&rsquo;re performing a SQL Server Failover Cluster installation and it is failing with a message like &ldquo;IP Address xyz is already in use. To continue, specify a different IP address.&rdquo;<span style="mso-spacerun: yes;">&nbsp; </span>You validate that this IP is <i style="mso-bidi-font-style: normal;">not</i> being used elsewhere and when you ping it, you don&rsquo;t get a response.<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';">Enter ARP and ARP caching as one area to validate.<span style="mso-spacerun: yes;">&nbsp; </span>ARP is a protocol that maps IPs to Ethernet MAC addresses.<span style="mso-spacerun: yes;">&nbsp; </span>A network router sitting in between a client and server can in turn have an ARP cache which holds a list of the IP/Mac mappings.<span style="mso-spacerun: yes;">&nbsp; </span>The cached mappings can be dynamic (created automatically) or static (created manually).<span style="mso-spacerun: yes;">&nbsp; </span>These mappings can have timeouts associated with them &ndash; causing disused entries to be removed after a set period of time.<span style="mso-spacerun: yes;">&nbsp; </span>You can view an ARP cache on your PC (for example &ndash; I did this on my Windows 7 OS) using &ldquo;arp &ndash;a&rdquo; at the command prompt. And as you can imagine, it is possible to have bad IP/MAC mappings.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';">There is also the concept of a Proxy ARP where a network device answers ARP requests on behalf of another destination and re-routes out the request accordingly.<span style="mso-spacerun: yes;">&nbsp; </span>This then relates to ARP cache poisoning where, in one manifestation of it, an ARP cache can be tampered with in order to point to a bad MAC address for a man-in-the-middle attack.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';">Back to SQL Server Failover Cluster install failures&hellip; The whole ARP caching concept is of particular interest to me in the context of SQL Server installations because I haven&rsquo;t yet seen it listed on standard SQL Server clustering / install checklists as something to validate (perhaps because the aforementioned issue shouldn&rsquo;t be too common).<span style="mso-spacerun: yes;">&nbsp; </span><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New';">So if you&rsquo;re seeing an &ldquo;already in use&rdquo; message for your SQL FC install and you&rsquo;re running out of ideas &ndash; ask your networking folks about ARP caching and look for bad entries that potentially need to be cleared out in order to continue with your install.<o:p></o:p></span></p>
<p><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"><span style="mso-spacerun: yes;">&nbsp; </span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Forced Parameterization with Filtered Indexes</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/forced-parameterization-with-filtered-indexes</link>
      <pubDate>Sun, 27 Mar 2011 09:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/03/27/forced-parameterization-with-filtered-indexes/</guid>
      <description><![CDATA[Consider the following scenario:


You have a database that has PARAMETERIZATION FORCED...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;">Consider the following scenario:<o:p></o:p></span></span></p>
<ul>
<li>
<div class="MsoListParagraphCxSpFirst" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">You have a database that has PARAMETERIZATION FORCED enabled.<o:p></o:p></span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpLast" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">You have a table using a filtered index.<o:p></o:p></span></span></span></div>
</li>
</ul>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">Here is a demo setup so you can follow along:</span></span></span></p>
<p class="MsoNormal">
<p><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">
<hr width="10" style="width: 10px;" />
</span></span></span><span style="font-family: 'Courier New'; color: green; mso-no-proof: yes;"><span style="font-size: small;">-- Create demo database<o:p></o:p></span></span></p>
</p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">USE</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> [master]<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">CREATE</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: blue;">DATABASE</span> [FI_PF_Error_Demo]<span style="color: gray;">;<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p><span style="font-size: small;">&nbsp;</span></o:p></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: green; mso-no-proof: yes;"><span style="font-size: small;">-- Set new database to forced parameterization<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">ALTER</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: blue;">DATABASE</span> [FI_PF_Error_Demo] <o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">SET</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: blue;">PARAMETERIZATION</span> <span style="color: blue;">FORCED</span> <span style="color: blue;">WITH</span> NO_WAIT<span style="color: gray;">;<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p><span style="font-size: small;">&nbsp;</span></o:p></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: green; mso-no-proof: yes;"><span style="font-size: small;">-- Create a demo table (and population will not be necessary to demonstrate)<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">USE</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> [FI_PF_Error_Demo]<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">CREATE</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: blue;">TABLE</span> dbo<span style="color: gray;">.</span>FI_PF_Demo_T <o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: gray; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; mso-no-proof: yes;">col01 <span style="color: blue;">int</span><span style="color: gray;">,</span> col02 <span style="color: blue;">int</span><span style="color: gray;">,</span> col03 <span style="color: blue;">int</span><span style="color: gray;">);<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: blue; font-size: 10pt; mso-no-proof: yes;"><o:p><span style="font-size: small;">&nbsp;</span></o:p></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; color: green; mso-no-proof: yes;"><span style="font-size: small;">-- Our filtered index referencing col01 as key and col03 in filter predicate<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">CREATE</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: blue;">NONCLUSTERED</span> <span style="color: blue;">INDEX</span> idx_FI_PF_Demo_T_col03 <o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">ON</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> dbo<span style="color: gray;">.</span>FI_PF_Demo_T<span style="color: gray;">(</span>col01<span style="color: gray;">)<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">WHERE </span><span style="font-family: 'Courier New'; color: gray; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; mso-no-proof: yes;">col03 <span style="color: gray;">=</span> 1924<span style="color: gray;">);<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO</span></span></p>
<p class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><span style="color: #000000;">&nbsp;</span></span></span></span>
<p><o:p></o:p></p>
</span></span>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">Now take the following query that uses the filtered index (using a hint to force this in the example, since there are no rows populated in this table):</span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"></span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: green; mso-no-proof: yes;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><span style="color: #000000;">&nbsp;</span></span></span></span></span></span>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: green; mso-no-proof: yes;">-- Tested on version 10.50.1600</span><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">SELECT</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> col01<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">FROM</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> dbo<span style="color: gray;">.</span>FI_PF_Demo_T<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">WITH </span><span style="font-family: 'Courier New'; color: gray; mso-no-proof: yes;">(</span><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">index</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: gray;">=</span> idx_FI_PF_Demo_T_col03 <span style="color: gray;">)</span> <o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; mso-no-proof: yes;">WHERE</span><span style="line-height: 115%; font-family: 'Courier New'; mso-no-proof: yes;"> col03 <span style="color: gray;">=</span> 1924<span style="color: gray;">;</span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="line-height: 115%; font-family: 'Courier New'; mso-no-proof: yes;"><span style="color: gray;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><span style="color: #000000;">&nbsp;</span></span></span></span>
<p><o:p></o:p></p>
</span></span></span>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">The following error is raised upon execution:</span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"></span></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; mso-no-proof: yes;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">&nbsp;</span></span></span></span></span>
<p class="MsoNormal"><span style="font-family: 'Courier New'; mso-no-proof: yes;"><span style="font-size: small;">Msg 8622, Level 16, State 1, Line 1</span></span></p>
<p class="MsoNormal"><span style="font-family: 'Courier New'; mso-no-proof: yes;"><span style="font-size: small;">Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN.<o:p></o:p></span></span></p>
<p class="MsoNormal"><o:p><span style="font-family: Calibri;"><span style="font-size: small;">&nbsp;<span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"> </span></span></span></span></span></o:p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">Now try turning off forced parameterization:</span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">&nbsp;</span></span></span></span></span></span>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="font-size: small;"><span style="font-family: 'Courier New'; color: blue; mso-no-proof: yes;">ALTER</span><span style="font-family: 'Courier New'; mso-no-proof: yes;"> <span style="color: blue;">DATABASE</span> [FI_PF_Error_Demo] <span style="color: blue;">SET</span> <span style="color: blue;">PARAMETERIZATION</span> <span style="color: blue;">SIMPLE</span> <span style="color: blue;">WITH</span> NO_WAIT<span style="color: gray;">;<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;">GO</span></span></p>
<p class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: blue; mso-no-proof: yes;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><span style="color: #000000;">&nbsp;</span></span></span></span>
<p><o:p></o:p></p>
</span></span>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="font-size: small;">Now if you re-run the SELECT query, you won&rsquo;t get error 8622.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="font-size: small;">So what&rsquo;s going on?<o:p></o:p></span></span></p>
<ul>
<li>
<div class="MsoListParagraphCxSpFirst"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">First of all, you may see 8622 in various contexts &ndash; this isn&rsquo;t just specific to this particular scenario.<span style="mso-spacerun: yes;">&nbsp; </span>Because I&rsquo;m using a hint, the QP is telling me I&rsquo;m forcing a non-viable plan that will not be compiled.<span style="mso-spacerun: yes;">&nbsp; </span>But in this demo &ndash; the root cause isn&rsquo;t <i style="mso-bidi-font-style: normal;">just</i> about the hint I designated.<o:p></o:p></span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpMiddle"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">With forced parameterization enabled, the SELECT query I executed is getting parameterized first.<span style="mso-spacerun: yes;">&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;</span>So for example col03 = 1924 becomes col03 = @p1.<o:p></o:p></span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpMiddle"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">This means that my original value of 1924 is <i style="mso-bidi-font-style: normal;">not</i> being considered when compiling the plan.<span style="mso-spacerun: yes;">&nbsp; </span>If I had a value not covered by the filtered index, then the filtered index I&rsquo;m forcing in the hint will not potentially fulfill all potential values.<o:p></o:p></span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpLast"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">Switching back to simple parameterization works because now the query isn&rsquo;t being parameterized and is compiled based on the 1924 value for col03.</span></span></span></div>
</li>
</ul>
</p>
</p>
</p>
</p>
</p>
</p>
</p>]]></content:encoded>
    </item>
    <item>
      <title>Two good Mondays in a row for the SQL MCM program</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/two-good-mondays-in-a-row-for-the-sql-mcm-program</link>
      <pubDate>Mon, 21 Feb 2011 15:24:25 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/02/21/two-good-mondays-in-a-row-for-the-sql-mcm-program/</guid>
      <description><![CDATA[The last two Mondays have brought us two new highly qualified Microsoft Certified Masters. If you’ve...]]></description>
      <content:encoded><![CDATA[<p>The last two Mondays have brought us two new highly qualified Microsoft Certified Masters. If you’ve been involved with the SQL Server community for the last few years, it’s likely you’ve already heard their names – Maciej Pilecki and certified today, Simon Sabin.</p>  <p>First – a little about Maciej:</p>  <p><b>Maciej Pilecki</b>, <i>Trainer and Consultant</i>, <a href="https://www.projectbotticelli.com/">Project Botticelli Ltd</a>.. Maciej is a SQL MVP and Microsoft Certified Trainer with many years of experience with SQL Server database development, optimization and troubleshooting. He travels around the world advising his many customers on how to improve performance and reliability of their SQL Server environments. He is also a prolific and highly rated speaker covering the SQL Server engine, SQLOS, Storage Engine, Query Optimizer and Performance tuning.</p>  <p>And – now background on Simon:</p>  <p><b>Simon Sabin</b>, <i>Principal Consultant</i> (<a href="https://sqlblogcasts.com/blogs/simons/">blog</a> | <a href="https://twitter.com/#!/simon_sabin">twitter</a>). Simon is the principal consultant for <a href="https://www.sqlknowhow.com/">SQL Know How</a> a company that delivers SQL Server Consultancy and Training. Specialising in the performance tuning and mentoring development teams to deliver high performance solutions utilising SQL Server. He has provided services for clients like Microsoft and Tesco. He has worked with SQL Server since 1998 and has always focused on high performance reliable systems. He has a particular expertise in the world of search, distributed architectures, business intelligence and application development. Making websites and applications run faster through scale out technologies and performance tuning the database.    <br />Simon was awarded as an MVP in 2006 and now SQL MCM in 2011. He runs user groups in London and Cambridge (<a href="https://www.SQLSocial.com">https://www.SQLSocial.com</a>) and in 2007 founded SQL Bits (Sqlbits.com) the largest SQL Server conference in the Europe. He is a regular speaker at SQL Server events as well as writing for his blog <a href="https://sqlblogcasts.com/blogs/simons">https://sqlblogcasts.com/blogs/simons</a>.</p>  <p>Welcome to the community and congrats on your achievement!</p>]]></content:encoded>
    </item>
    <item>
      <title>One less “uncertified Master”</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/one-less-uncertified-master</link>
      <pubDate>Thu, 10 Feb 2011 18:47:58 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/02/10/one-less-uncertified-master/</guid>
      <description><![CDATA[News travels pretty fast, so I thought I would get the official word out tonight before this news...]]></description>
      <content:encoded><![CDATA[<p>News travels pretty fast, so I thought I would get the official word out tonight before this news became too stale.</p>  <p>As many already know, three months ago we announced some pretty <a href="https://www.microsoft.com/presspass/features/2010/nov10/11-09sqlservermcm.mspx" target="_blank">significant changes to the SQL MCM program</a>. I won’t recap those changes in great detail here, but the bottom line is that we wanted to remove some of the barriers of cost, duration and location from the SQL MCM certification requirements.</p>  <p>Why? One big reason was so we could reach more of the “uncertified Masters” we <i>know</i> are already out there.</p>  <p>And today there is now one less “uncertified Master”. Congratulations to Denny Cherry, our newest Microsoft Certified Master for SQL Server 2008!</p>  <p>A little background on Denny:</p>  <blockquote>   <p><b><a href="https://itke.techtarget.com/sql-server/" target="_blank">Denny Cherry</a></b>, <i>Sr. Database Administrator</i>. Denny Cherry has over a decade of experience managing SQL Server, including MySpace.com’s over 175 million user installations (one of the largest in the world). Denny’s areas of technical expertise include system architecture, performance tuning, replication and troubleshooting. Denny currently holds several Microsoft Certifications related to SQL Server as well as being a Microsoft MVP. Denny is a longtime member of PASS and Quest Software’s Association of SQL Server Experts and has written numerous technical articles on SQL Server management.</p> </blockquote>  <p>Needless to say, we’re very happy (and proud) to have Denny joining the community. </p>]]></content:encoded>
    </item>
    <item>
      <title>Last batch of SQL MCM videos now published</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/last-batch-of-sql-mcm-videos-now-published</link>
      <pubDate>Mon, 03 Jan 2011 19:27:42 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2011/01/03/last-batch-of-sql-mcm-videos-now-published/</guid>
      <description><![CDATA[Our last planned batch of SQL Server 2008 MCM Readiness Videos are now published – covering...]]></description>
      <content:encoded><![CDATA[<p>Our last planned batch of <a href="https://technet.microsoft.com/en-us/sqlserver/ff977043.aspx" target="_blank">SQL Server 2008 MCM Readiness Videos</a> are now published – covering Partitioning, Snapshot Isolation, EXECUTE AS, SQL Injection, Replication, Partial Database Availability, Online Piecemeal Restore, optimizing procedural code, a demo of multi-server management, indexing strategies, index analysis, designing an availability strategy, Failover Cluster setup &amp; troubleshooting and consolidation.</p>  <p>This is the final batch of videos.&#160; I hope we can extend something similar again in the future, but we’ll see.&#160; It will depend on several factors.&#160; </p>  <p>I hope that you find these videos to be helpful and for those of you studying for SQL MCM certification, best of luck to you!</p>]]></content:encoded>
    </item>
    <item>
      <title>Second batch of SQL MCM Readiness Videos now Released</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/second-batch-of-sql-mcm-readiness-videos-now-released</link>
      <pubDate>Wed, 15 Dec 2010 13:43:09 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2010/12/15/second-batch-of-sql-mcm-readiness-videos-now-released/</guid>
      <description><![CDATA[We just added another 23 videos on Technet – making it a total of 56 videos available as of today....]]></description>
      <content:encoded><![CDATA[<p>We just added another 23 videos on Technet – making it a total of 56 videos available as of today. The new videos cover storage core concepts &amp; guidelines, DAS vs SAN architecture, storage testing and monitoring, index internals, the clustered index debate, statistics, locking, restore internals, Waits and Queues, a clustering introduction, SQLOS concepts, database mirroring, multi-server management, PBM and Resource Governor. </p>  <p>A few things to be aware of:</p>  <p>· The main <a href="https://technet.microsoft.com/en-us/sqlserver/ff977043.aspx" target="_blank">landing page</a> shows a rotating random video, followed by 10 of the most recently posted videos.</p>  <p>· The “<a href="https://www.microsoft.com/feeds/TechNet/en-us/How-to-videos/SQL_Server_2008_Microsoft_Certified_Master_(MCM)_Readiness_Videos.xml" target="_blank">more</a>” link leads to the full list of available videos (56 videos as of today). By the way - this link <i>is</i> an XML page – which is by design for Technet.</p>  <p>· Each individual video page has the option of streaming the page in the browser or downloading video or audio files in varying formats (typically about 10+ download links per video). Right now this means there are 560+ individual links that get updated by the Technet team. Although I do random checks upon publication, I definitely don’t test every link. There have been instances of broken links or other bugs – so if you find them, please ping me directly and I’ll investigate and submit a fix request to the Technet team. Depending on when an issue is found it can take a couple of days to fix, but it <i>will</i> get fixed.</p>  <p>I hope you find these videos to be valuable (whether or not you use them for SQL MCM readiness).</p>]]></content:encoded>
    </item>
    <item>
      <title>How do you know if you’re ready for SQL MCM?</title>
      <link>https://docs.microsoft.com/archive/blogs/joesack/how-do-you-know-if-youre-ready-for-sql-mcm</link>
      <pubDate>Sun, 21 Nov 2010 13:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Sack]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joesack/2010/11/21/how-do-you-know-if-youre-ready-for-sql-mcm/</guid>
      <description><![CDATA[&ldquo;Know what you know. Know what you don&rsquo;t know. Don&rsquo;t ever confuse the two.&rdquo;...]]></description>
      <content:encoded><![CDATA[<p>&ldquo;<i>Know what you know. Know what you don&rsquo;t know. Don&rsquo;t ever confuse the two.</i>&rdquo; Per Farny, founder of the original Microsoft Certified Master and Architect program</p>
<p>How do you know if you are ready to take the Microsoft Certified Master SQL Server 2008 exams? This is a common question and a perfectly valid one, especially given the <a target="_blank" href="https://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx">recently announced SQL MCM program changes</a>.</p>
<p>Giving recommendations on this topic is a bit of a balancing act&hellip; We want to provide enough information to guide an individual&rsquo;s preparation &ndash; but not so much detail that it makes it too easy to pass the exams. The legacy SQL MCM candidates faced a similar challenge in that the final Lab Exam scope and coverage was not disclosed in advance. Candidates only knew that the Lab Exam was going to test &ldquo;hands-on, real world&rdquo; advanced SQL Server competencies. This description is pretty open ended and sometimes not even the top experts were able to pass the Lab Exam on the first attempt.</p>
<blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/17/45/metablogapi/0243.86_6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-17-45-metablogapi/0243.86_5F00_6.jpg"><img height="235" width="312" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/17/45/metablogapi/5417.86_thumb_2.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-17-45-metablogapi/5417.86_5F00_thumb_5F00_2.jpg" align="right" alt="86" border="0" title="86" style="border-bottom: 0px; border-left: 0px; margin: 5px 0px; display: inline; border-top: 0px; border-right: 0px" /></a> </p>
</blockquote>
<p>&nbsp;</p>
<p>So how <i>do</i> you know if you are ready? I&rsquo;ll provide some guidance and recommendations based on what I&rsquo;ve witnessed over the last year and a half &ndash; and also based on my own experience going through the program back in 2006 and taking the upgrade in 2008. My seven tips are as follows:</p>
<p>1. Read the <a target="_blank" href="https://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx#exam-topics">Exam Topics</a> and ask yourself if you have experience in this area. Be real with yourself. Have you done what is listed? The seven competencies aren&rsquo;t incredibly detailed &ndash; but they do contain quite a bit of implied knowledge and experience. Make sure you feel comfortable in each area.</p>
<p>2. Watch the <a target="_blank" href="https://technet.microsoft.com/en-us/sqlserver/ff977043.aspx">SQL MCM Readiness Videos</a>. Do you feel comfortable with the subjects as you watch them? Did you already know most everything you&rsquo;ve been watching? These videos give you an indication of the program&rsquo;s depth and breadth &ndash; so these will act as a good hint of your overall readiness.</p>
<p>3. Look over the reading list &ndash; including the <a target="_blank" href="https://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx#mcm-microsoft-sql-server-2008-readiness">books and white papers</a>. Also check out the <a target="_blank" href="https://www.sqlskills.com/mcm.asp">reading list that SQLSkills.com</a> put together (Microsoft doesn&rsquo;t manage this list &ndash; but it&rsquo;s put together by the original instructors for the SQL MCM program). Have you read most of this list already? Have you been reading this over time? If affirmative, that&rsquo;s a good sign.</p>
<p>4. Look at the various people who have made it through the program to date. Look at their background on <a target="_blank" href="https://blogs.technet.com/b/themasterblog/archive/tags/sql/">The Master Blog</a> and ask yourself if it is similar to yours. We do have a wide variety of job roles in the SQL MCM community today, but there are certain themes that can be extracted from the data (years of experience, immersion in SQL Server, experience in mission critical environments). Have a look at the various announcements over the last year and see if your background is similar.</p>
<p>5. Do you know a SQL MCM? If so, talk to them about your background and experience and get their feedback. They aren&rsquo;t going to coach you on the exams or give you answers, but they can compare your background with other people in the community and see if you&rsquo;re close to the mark or need a few more years of experience.</p>
<p>6. Another option is to just jump right in and give the exams a try. This is potentially a more costly method because you may not pass the Knowledge Exam on the first attempt. Also, you cannot take the Lab Exam <i>until</i> you pass the Knowledge Exam. You should also know that the two exams are distinct entities &ndash; and while the Knowledge Exam acts as a first filter, the hands-on Lab Exam is the core of the SQL MCM program (just as it has been in the past). Taking the Knowledge Exam without certainty of your background is a perfectly valid approach if you have the means to do so &ndash; but just remember that there is a 90 day waiting period between exam attempts and that the content may change over time.</p>
<p>7. Instructor-led training more your style? Then my recommendation is you attend advanced training where available and depending on your budget and time. <span style="text-decoration: line-through;">At Microsoft we&rsquo;re working on releasing four new advanced instructor-led training courses that will be available through select Microsoft Learning Partners in the first half of 2011</span> (** Update - we put that aforementioned courseware on hold and are looking at other ways to get out advanced&nbsp;instruction to the broader SQL Server community - stay tuned **). Also, there are several top SQL experts that participated in the original SQL MCM training experience. If you have an opportunity to get advanced instruction from the likes of Paul Randal, Kimberly Tripp, Adam Machanic and Greg Low &ndash; this can only help you (their training was often viewed as the best part of the legacy SQL MCM experience). Other trainers like Kalen Delaney and Bob Beauchemin (who helped in the re-launch of the SQL MCM program) also provide advanced training options and an incredible experience. Regardless of where you get your advanced training, this may be another way to validate your readiness.</p>
<p>Last point I want to get across&hellip; <i>Experience is paramount</i>. Look over the scope of the exams and find ways to get hands-on experience.</p>
<p>Hope this helps.</p>]]></content:encoded>
    </item>
  </channel>
</rss>