<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PAGELATCH_EX Contention on 2:1:103</title>
	<atom:link href="http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/</link>
	<description>Database Whisperer</description>
	<lastBuildDate>Thu, 16 May 2013 21:21:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: opc.three</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9722</link>
		<dc:creator>opc.three</dc:creator>
		<pubDate>Tue, 05 Mar 2013 22:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9722</guid>
		<description><![CDATA[Thanks again for the reply. The parameterized query you showed being executed using sp_executesql in your sample code was very helpful towards knowing a specific use of table types that can cause the types of contention issues you were tracking.]]></description>
		<content:encoded><![CDATA[<p>Thanks again for the reply. The parameterized query you showed being executed using sp_executesql in your sample code was very helpful towards knowing a specific use of table types that can cause the types of contention issues you were tracking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J. Swart</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9721</link>
		<dc:creator>Michael J. Swart</dc:creator>
		<pubDate>Tue, 05 Mar 2013 21:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9721</guid>
		<description><![CDATA[Right. I understand you now.

So ADO.net is the one that declares and populates the variable before calling the stored procedure. 
For what it&#039;s worth, I do see that SQL Server is able to re-use cached temp tables in this case. And I expect that invoking the stored procedure explicitly (without ado.net&#039;s help) works the same.

Now for what I call ad hoc queries or parameterized queries (where the ADO.net SqlCommand object uses CommandType.Text) ADO.net issues something like the following under the covers: 
&lt;pre lang=&quot;tsql&quot;&gt;
declare @p3 dbo.BigIntList
insert into @p3 values(1)
insert into @p3 values(2)
insert into @p3 values(3)
insert into @p3 values(4)
insert into @p3 values(5)
insert into @p3 values(6)
insert into @p3 values(7)

exec sp_executesql N&#039;SELECT i FROM @list WHERE i % 2 = 0&#039;,N&#039;@list [dbo].[BigIntList] READONLY&#039;,@list=@p3
&lt;/pre&gt;

And it&#039;s that example that caused us grief and it&#039;s also that example that Microsoft has been able to demonstrate a performance improvement in 2012 because SQL Server 2012 is able to cache and re-use temp tables where SQL Server 2008 and R2 could not.

So now that that&#039;s cleared up. From what you&#039;ve said earlier, I believe that you&#039;re using TVPs in a way where you won&#039;t have to worry about tempdb contention.]]></description>
		<content:encoded><![CDATA[<p>Right. I understand you now.</p>
<p>So ADO.net is the one that declares and populates the variable before calling the stored procedure.<br />
For what it&#8217;s worth, I do see that SQL Server is able to re-use cached temp tables in this case. And I expect that invoking the stored procedure explicitly (without ado.net&#8217;s help) works the same.</p>
<p>Now for what I call ad hoc queries or parameterized queries (where the ADO.net SqlCommand object uses CommandType.Text) ADO.net issues something like the following under the covers:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">declare</span> @p3 dbo.<span style="color: #202020;">BigIntList</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">1</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">2</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">3</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">4</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">5</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p3 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">7</span><span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">exec</span> <span style="color: #AF0000;">sp_executesql</span> N<span style="color: #FF0000;">'SELECT i FROM @list WHERE i % 2 = 0'</span>,N<span style="color: #FF0000;">'@list [dbo].[BigIntList] READONLY'</span>,@list<span style="color: #808080;">=</span>@p3</pre></td></tr></table></div>

<p>And it&#8217;s that example that caused us grief and it&#8217;s also that example that Microsoft has been able to demonstrate a performance improvement in 2012 because SQL Server 2012 is able to cache and re-use temp tables where SQL Server 2008 and R2 could not.</p>
<p>So now that that&#8217;s cleared up. From what you&#8217;ve said earlier, I believe that you&#8217;re using TVPs in a way where you won&#8217;t have to worry about tempdb contention.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: opc.three</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9720</link>
		<dc:creator>opc.three</dc:creator>
		<pubDate>Tue, 05 Mar 2013 21:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9720</guid>
		<description><![CDATA[Thanks for the reply. 

** Then I consider @MyListOfInts a table variable the same way that I consider @Tablename a string variable in:

DECLARE @Tablename sysname**

OK, I do not consider them the same thing and here is why...we can say this:

&lt;pre lang=&quot;tsql&quot;&gt;DECLARE @tt AS IntSet; -- Table Type

EXEC dbo.SampleDataTypeProcedure 
    @SampleDataType = @tt;&lt;/pre&gt;

But this:
    
&lt;pre lang=&quot;tsql&quot;&gt;DECLARE @tt AS TABLE (Value INT); -- Table Variable with the same definition as the Table Type

EXEC dbo.SampleDataTypeProcedure 
    @SampleDataType = @tt;&lt;/pre&gt;

Results in error:

Msg 206, Level 16, State 2, Procedure SampleDataTypeProcedure, Line 0
Operand type clash: table is incompatible with SampleDataType


** So when using stored procedures, I don’t declare and populate a table during the batch, but I do something like the following instead. Table Valued Parameters, A Short, Complete Example **

I think I know where we have a disconnect. The code sample in the article uses the SqlCommand object to map a ADO.NET DataTable to a stored procedure parameter. While there is nothing explicit in the C# code that says &quot;declare a variable of Type BigIntList and populate it then call the proc&quot; under the covers this is what is actually being generated by the ADO.NET object and shipped via RPC to the server when ExecuteReader() is called:

&lt;pre lang=&quot;tsql&quot;&gt;declare @p1 dbo.BigIntList
insert into @p1 values(1)
insert into @p1 values(2)
insert into @p1 values(3)
insert into @p1 values(4)
insert into @p1 values(5)
insert into @p1 values(6)
insert into @p1 values(7)

exec ReturnEvenNumbers @list=@p1&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Thanks for the reply. </p>
<p>** Then I consider @MyListOfInts a table variable the same way that I consider @Tablename a string variable in:</p>
<p>DECLARE @Tablename sysname**</p>
<p>OK, I do not consider them the same thing and here is why&#8230;we can say this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">DECLARE</span> @tt <span style="color: #0000FF;">AS</span> IntSet; <span style="color: #008080;">-- Table Type</span>
&nbsp;
<span style="color: #0000FF;">EXEC</span> dbo.<span style="color: #202020;">SampleDataTypeProcedure</span> 
    @SampleDataType <span style="color: #808080;">=</span> @tt;</pre></td></tr></table></div>

<p>But this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">DECLARE</span> @tt <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">TABLE</span> <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">Value</span> <span style="color: #0000FF;">INT</span><span style="color: #808080;">&#41;</span>; <span style="color: #008080;">-- Table Variable with the same definition as the Table Type</span>
&nbsp;
<span style="color: #0000FF;">EXEC</span> dbo.<span style="color: #202020;">SampleDataTypeProcedure</span> 
    @SampleDataType <span style="color: #808080;">=</span> @tt;</pre></td></tr></table></div>

<p>Results in error:</p>
<p>Msg 206, Level 16, State 2, Procedure SampleDataTypeProcedure, Line 0<br />
Operand type clash: table is incompatible with SampleDataType</p>
<p>** So when using stored procedures, I don’t declare and populate a table during the batch, but I do something like the following instead. Table Valued Parameters, A Short, Complete Example **</p>
<p>I think I know where we have a disconnect. The code sample in the article uses the SqlCommand object to map a ADO.NET DataTable to a stored procedure parameter. While there is nothing explicit in the C# code that says &#8220;declare a variable of Type BigIntList and populate it then call the proc&#8221; under the covers this is what is actually being generated by the ADO.NET object and shipped via RPC to the server when ExecuteReader() is called:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">declare</span> @p1 dbo.<span style="color: #202020;">BigIntList</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">1</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">2</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">3</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">4</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">5</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">insert</span> <span style="color: #0000FF;">into</span> @p1 <span style="color: #0000FF;">values</span><span style="color: #808080;">&#40;</span><span style="color: #000;">7</span><span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">exec</span> ReturnEvenNumbers @list<span style="color: #808080;">=</span>@p1</pre></td></tr></table></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J. Swart</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9719</link>
		<dc:creator>Michael J. Swart</dc:creator>
		<pubDate>Tue, 05 Mar 2013 18:24:38 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9719</guid>
		<description><![CDATA[Hey there opc.three. Thanks for coming by. 

It&#039;s entirely possible that I&#039;ve been sloppy with the terms I&#039;ve used to talk about temp table variables and table valued parameters.

Your first question about using a TVP in a parameterized query. What I mean is code similar to the example at the bottom of &lt;a href = &quot;http://blogs.msdn.com/b/psssql/archive/2013/02/26/temp-table-caching-improvement-for-table-valued-parameters-in-sql-server-2012.aspx&quot; rel=&quot;nofollow&quot;&gt;Temp table caching improvement for table valued parameters in SQL Server 2012&lt;/a&gt;. I have a reproduction at the follow-up (linked at the top of this page) which matches even more closely what I mean by TVPs in parameterized queries. That reproduction is likely what you&#039;re asking for.

For your second question, &quot;table variable&quot; and &quot;table type&quot; are not quite interchangeable in my head, but in my examples each table variable that is declared is a user defined type. So when I&#039;ve defined a table type like:
&lt;pre lang=&quot;tsql&quot;&gt;
CREATE TYPE IntSet AS TABLE (Value INT)
&lt;/pre&gt;
And create a variable of that type:
&lt;pre lang=&quot;tsql&quot;&gt;
DECLARE @MyListOfInts IntSet
&lt;/pre&gt;
Then I consider @MyListOfInts a table variable the same way that I consider @Tablename a string variable in:
&lt;pre lang=&quot;tsql&quot;&gt;
DECLARE @Tablename sysname
&lt;/pre&gt;

So when using stored procedures, I don&#039;t declare and populate a table during the batch, but I do something like the following instead. &lt;a href=&quot;http://michaeljswart.com/2011/01/a-short-complete-table-valued-parameter-example/&quot; rel=&quot;nofollow&quot;&gt;Table Valued Parameters, A Short, Complete Example&lt;/a&gt;

I hope I&#039;ve answered your questions. There&#039;s a chance that I didn&#039;t address the thing you&#039;re wondering about.]]></description>
		<content:encoded><![CDATA[<p>Hey there opc.three. Thanks for coming by. </p>
<p>It&#8217;s entirely possible that I&#8217;ve been sloppy with the terms I&#8217;ve used to talk about temp table variables and table valued parameters.</p>
<p>Your first question about using a TVP in a parameterized query. What I mean is code similar to the example at the bottom of <a href = "http://blogs.msdn.com/b/psssql/archive/2013/02/26/temp-table-caching-improvement-for-table-valued-parameters-in-sql-server-2012.aspx" rel="nofollow">Temp table caching improvement for table valued parameters in SQL Server 2012</a>. I have a reproduction at the follow-up (linked at the top of this page) which matches even more closely what I mean by TVPs in parameterized queries. That reproduction is likely what you&#8217;re asking for.</p>
<p>For your second question, &#8220;table variable&#8221; and &#8220;table type&#8221; are not quite interchangeable in my head, but in my examples each table variable that is declared is a user defined type. So when I&#8217;ve defined a table type like:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">CREATE</span> TYPE IntSet <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">TABLE</span> <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">Value</span> <span style="color: #0000FF;">INT</span><span style="color: #808080;">&#41;</span></pre></td></tr></table></div>

<p>And create a variable of that type:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">DECLARE</span> @MyListOfInts IntSet</pre></td></tr></table></div>

<p>Then I consider @MyListOfInts a table variable the same way that I consider @Tablename a string variable in:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">DECLARE</span> @Tablename sysname</pre></td></tr></table></div>

<p>So when using stored procedures, I don&#8217;t declare and populate a table during the batch, but I do something like the following instead. <a href="http://michaeljswart.com/2011/01/a-short-complete-table-valued-parameter-example/" rel="nofollow">Table Valued Parameters, A Short, Complete Example</a></p>
<p>I hope I&#8217;ve answered your questions. There&#8217;s a chance that I didn&#8217;t address the thing you&#8217;re wondering about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: opc.three</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9718</link>
		<dc:creator>opc.three</dc:creator>
		<pubDate>Tue, 05 Mar 2013 17:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9718</guid>
		<description><![CDATA[The site ate some of my earlier post, likely because of my use of angle brackets so I am trying again...

Thanks for the article. I am huge fan of passing table valued parameters to stored procedures, but am concerned about the contention issues and the lack of tools we have to combat it but I need some clarification on a couple of items from the article.

** But who creates temp tables that often? We did, just by using a table valued parameter in a parameterized query. Since SQL Server began supporting table valued parameters (introduced in SQL Server 2008), we have been gradually moving towards this practice in lieu of sending xml to be shredded. **

Can you please provide a sample of the code you are passing to the database that is representative of &quot;a table valued parameter in a parameterized query&quot;?

** I’m recommending that developers not create temp tables or declare table variables that cannot be cached. For now, this means we use stored procedures for any query that uses table variables or temp tables. **

Are you using &quot;table variable&quot; and &quot;table type&quot; interchangeably here? How would one call a procedure that accepts a table valued parameter without first declaring it in the batch, populating it, and then passing it in as a parameter in a similar fashion to what the code sample on Books Online shows here? http://msdn.microsoft.com/en-us/library/bb510489(v=sql.105).aspx#sectionToggle2]]></description>
		<content:encoded><![CDATA[<p>The site ate some of my earlier post, likely because of my use of angle brackets so I am trying again&#8230;</p>
<p>Thanks for the article. I am huge fan of passing table valued parameters to stored procedures, but am concerned about the contention issues and the lack of tools we have to combat it but I need some clarification on a couple of items from the article.</p>
<p>** But who creates temp tables that often? We did, just by using a table valued parameter in a parameterized query. Since SQL Server began supporting table valued parameters (introduced in SQL Server 2008), we have been gradually moving towards this practice in lieu of sending xml to be shredded. **</p>
<p>Can you please provide a sample of the code you are passing to the database that is representative of &#8220;a table valued parameter in a parameterized query&#8221;?</p>
<p>** I’m recommending that developers not create temp tables or declare table variables that cannot be cached. For now, this means we use stored procedures for any query that uses table variables or temp tables. **</p>
<p>Are you using &#8220;table variable&#8221; and &#8220;table type&#8221; interchangeably here? How would one call a procedure that accepts a table valued parameter without first declaring it in the batch, populating it, and then passing it in as a parameter in a similar fashion to what the code sample on Books Online shows here? <a href="http://msdn.microsoft.com/en-us/library/bb510489(v=sql.105)" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb510489(v=sql.105)</a>.aspx#sectionToggle2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Follow up on Ad Hoc TVP contention &#124; Michael J. Swart</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9694</link>
		<dc:creator>Follow up on Ad Hoc TVP contention &#124; Michael J. Swart</dc:creator>
		<pubDate>Thu, 28 Feb 2013 17:41:43 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9694</guid>
		<description><![CDATA[[...] month I posted PAGELATCH Contention on 2:1:103. It described a troubleshooting experience I had. I was troubleshooting a performance problem that [...]]]></description>
		<content:encoded><![CDATA[<p>[...] month I posted PAGELATCH Contention on 2:1:103. It described a troubleshooting experience I had. I was troubleshooting a performance problem that [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Thul</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9665</link>
		<dc:creator>Ben Thul</dc:creator>
		<pubDate>Fri, 15 Feb 2013 23:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9665</guid>
		<description><![CDATA[Here&#039;s a crazy thought: what if it&#039;s a system thread? There&#039;s a sqlserver.is_system action. Heck, there&#039;s a bunch of interesting actions you could add here (sqlserver.client_hostname could be instructive). The game is afoot!]]></description>
		<content:encoded><![CDATA[<p>Here&#8217;s a crazy thought: what if it&#8217;s a system thread? There&#8217;s a sqlserver.is_system action. Heck, there&#8217;s a bunch of interesting actions you could add here (sqlserver.client_hostname could be instructive). The game is afoot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J. Swart</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9663</link>
		<dc:creator>Michael J. Swart</dc:creator>
		<pubDate>Fri, 15 Feb 2013 21:05:52 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9663</guid>
		<description><![CDATA[Hmmm... 
&quot;optimize for ad hoc workloads&quot; = 0
and
&lt;pre lang=&quot;xml&quot;&gt;
    &lt;action name=&quot;plan_handle&quot; package=&quot;sqlserver&quot;&gt;
      &lt;type name=&quot;unicode_string&quot; package=&quot;package0&quot; /&gt;
      &lt;value&gt;&lt;plan handle=&#039;0x000000000000000000000000000000000000000000000000&#039;/&gt;&lt;/value&gt;
      &lt;text /&gt;
    &lt;/action&gt;
&lt;/pre&gt;

I don&#039;t think that it&#039;s a coincidence that finding a query (or even a plan) here is just as difficult as the efforts I describe in the section &quot;Finding Such Queries Is Difficult&quot;. I don&#039;t know what the common cause is, I just know I have to look elsewhere.]]></description>
		<content:encoded><![CDATA[<p>Hmmm&#8230;<br />
&#8220;optimize for ad hoc workloads&#8221; = 0<br />
and</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;plan_handle&quot;</span> <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;sqlserver&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;unicode_string&quot;</span> <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;package0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #ddbb00;">&amp;lt;</span>plan handle='0x000000000000000000000000000000000000000000000000'/<span style="color: #ddbb00;">&amp;gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>I don&#8217;t think that it&#8217;s a coincidence that finding a query (or even a plan) here is just as difficult as the efforts I describe in the section &#8220;Finding Such Queries Is Difficult&#8221;. I don&#8217;t know what the common cause is, I just know I have to look elsewhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Thul</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9662</link>
		<dc:creator>Ben Thul</dc:creator>
		<pubDate>Fri, 15 Feb 2013 20:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9662</guid>
		<description><![CDATA[Is the plan handle non-empty? If you get something back for that, use it to at least get a query plan. One thing that might be killing you is the optimize for ad hoc server setting. If you truly suspect that it&#039;s ad hoc queries, then those plans aren&#039;t going to be in cache.]]></description>
		<content:encoded><![CDATA[<p>Is the plan handle non-empty? If you get something back for that, use it to at least get a query plan. One thing that might be killing you is the optimize for ad hoc server setting. If you truly suspect that it&#8217;s ad hoc queries, then those plans aren&#8217;t going to be in cache.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J. Swart</title>
		<link>http://michaeljswart.com/2013/01/pagelatch-contention-on-21103/comment-page-1/#comment-9661</link>
		<dc:creator>Michael J. Swart</dc:creator>
		<pubDate>Fri, 15 Feb 2013 19:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://michaeljswart.com/?p=3314#comment-9661</guid>
		<description><![CDATA[Great effort Ben, but it looks like the extended event is suffering from the same issue as dmv query that uses &quot;outer apply fn_get_sql&quot;
And I get a lot of this: 
&lt;pre lang=&quot;xml&quot;&gt;
    &lt;action name=&quot;tsql_stack&quot; package=&quot;sqlserver&quot;&gt;
      &lt;type name=&quot;unicode_string&quot; package=&quot;package0&quot; /&gt;
      &lt;value&gt;Unable to retrieve T-SQL stack&lt;/value&gt;
      &lt;text /&gt;
    &lt;/action&gt;
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Great effort Ben, but it looks like the extended event is suffering from the same issue as dmv query that uses &#8220;outer apply fn_get_sql&#8221;<br />
And I get a lot of this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;tsql_stack&quot;</span> <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;sqlserver&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;unicode_string&quot;</span> <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;package0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Unable to retrieve T-SQL stack<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 1/13 queries in 0.044 seconds using disk: basic
Object Caching 317/317 objects using disk: basic

 Served from: michaeljswart.com @ 2013-05-21 06:42:06 by W3 Total Cache -->