<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www2.sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx</link><description>Lock escalation is a funny thing. I've found myself on numerous occasions waging war against its concurrency-sapping existence, and rarely have I found myself wishing that it would work more aggressively. But there is a time and place for everything,</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#18433</link><pubDate>Sun, 01 Nov 2009 06:14:42 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18433</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hi Adam&lt;/p&gt;
&lt;p&gt;Its intresting. I have been doing lots on such things recently. How do you insert 100 million rows? One batch? Using trace 610?&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#18447</link><pubDate>Sun, 01 Nov 2009 23:29:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18447</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Uri,&lt;/p&gt;
&lt;p&gt;One batch, in this case. I'm not familiar with TF 610--what does it do?&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#18454</link><pubDate>Mon, 02 Nov 2009 07:43:51 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18454</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hi Adam&lt;/p&gt;
&lt;p&gt;Hmm, 100 million on one batch, I have to test it :-)&lt;/p&gt;
&lt;p&gt;&amp;gt;I'm not familiar with TF 610--what does it do?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/sqlserverstorageengine/archive/2008/03/23/minimal-logging-changes-in-sql-server-2008-part-2.aspx"&gt;http://blogs.msdn.com/sqlserverstorageengine/archive/2008/03/23/minimal-logging-changes-in-sql-server-2008-part-2.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#18467</link><pubDate>Mon, 02 Nov 2009 15:59:55 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18467</guid><dc:creator>Abe Weinograd</dc:creator><description>&lt;p&gt;Hi Adam,&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/dd425070.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd425070.aspx&lt;/a&gt; &amp;nbsp;That article has been really helpful. &amp;nbsp;I have outright disabled lock escalation and used TF 610 to help here. &amp;nbsp;I had to also play with batchsizes to get optimal performance.&lt;/p&gt;
&lt;p&gt;I found that even when inserting in the order of the clustered index with concurrentinserts, i had to use a real batch size. &amp;nbsp;If you are inserting into an index concurrently, i think you have to make sure that the data sets are non overlapping.&lt;/p&gt;
&lt;p&gt;Abe&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#18513</link><pubDate>Wed, 04 Nov 2009 00:21:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:18513</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Unfortunately, I can't do minimal logging in my scenario, because we have CDC enabled on the table (whether or not this is a good use for CDC is a whole other topic). And while I can stop the key locks on the main insert, I can't control what CDC does; it will kick in and cause the same problem when it does its own work.&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#21069</link><pubDate>Fri, 15 Jan 2010 11:42:46 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:21069</guid><dc:creator>Florian Reischl</dc:creator><description>&lt;p&gt;Just referred at&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.mycsharp.de/wbb2/thread.php?threadid=80507"&gt;http://www.mycsharp.de/wbb2/thread.php?threadid=80507&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(German)&lt;/p&gt;
&lt;p&gt;Greets&lt;/p&gt;
&lt;p&gt;Flo&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#21080</link><pubDate>Fri, 15 Jan 2010 14:42:57 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:21080</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Thanks, Flo. Now translate it for me :-)&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#43445</link><pubDate>Fri, 18 May 2012 09:44:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43445</guid><dc:creator>bjan</dc:creator><description>&lt;p&gt;I am looking for Dont Escalate and failed to achieve row level locking. Please look at &lt;a rel="nofollow" target="_new" href="http://stackoverflow.com/questions/10648448/i-need-row-level-locking"&gt;http://stackoverflow.com/questions/10648448/i-need-row-level-locking&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: SQL Server 2008: Lock Escalation, INSERTs, and a Potential Bug</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2009/10/30/sql-server-2008-lock-escalation-inserts-and-a-potential-bug.aspx#46709</link><pubDate>Wed, 19 Dec 2012 20:33:02 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:46709</guid><dc:creator>Murali</dc:creator><description>&lt;p&gt;I definitely agree Adam.. I noticed the same exact strange behaviour in SQL 2008&lt;/p&gt;
</description></item></channel></rss>