<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://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>Revisiting the transaction batch size</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2010/08/01/revisiting-the-transaction-batch-size.aspx</link><description>It’s a well known good practice to control the batch size when you perform large data changes. For instance, you may need to purge a large amount of data monthly, and if you delete them all in one shot, you may blow up your transaction log. Therefore,</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Revisiting the transaction batch size</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2010/08/01/revisiting-the-transaction-batch-size.aspx#27476</link><pubDate>Sun, 01 Aug 2010 05:26:18 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27476</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hi Linci&lt;/p&gt;
&lt;p&gt;You said that you eliminated loop so what is your T-SQL statement?&lt;/p&gt;
&lt;p&gt;WHILE 1 = 1&lt;/p&gt;
&lt;p&gt;BEGIN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; DELETE TOP(100000)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; FROM Foo&lt;/p&gt;
&lt;p&gt; &amp;nbsp; WHERE &amp;lt;range on the cikey &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; IF @@ROWCOUNT &amp;lt; 2000 BREAK;&lt;/p&gt;
&lt;p&gt;END&lt;/p&gt;
</description></item><item><title>re: Revisiting the transaction batch size</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2010/08/01/revisiting-the-transaction-batch-size.aspx#27477</link><pubDate>Sun, 01 Aug 2010 05:26:20 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27477</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hi Linci&lt;/p&gt;
&lt;p&gt;You said that you eliminated loop so what is your T-SQL statement?&lt;/p&gt;
&lt;p&gt;WHILE 1 = 1&lt;/p&gt;
&lt;p&gt;BEGIN&lt;/p&gt;
&lt;p&gt; &amp;nbsp; DELETE TOP(100000)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; FROM Foo&lt;/p&gt;
&lt;p&gt; &amp;nbsp; WHERE &amp;lt;range on the cikey &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; IF @@ROWCOUNT &amp;lt; 2000 BREAK;&lt;/p&gt;
&lt;p&gt;END&lt;/p&gt;
</description></item><item><title>re: Revisiting the transaction batch size</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2010/08/01/revisiting-the-transaction-batch-size.aspx#27478</link><pubDate>Sun, 01 Aug 2010 06:25:40 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27478</guid><dc:creator>Chris Howarth</dc:creator><description>&lt;p&gt;Don't forget that log files can't be instantly initialised during creation, so if there is a requirement to keep database restore time (and therefore down time) to a minimum, then, during the restore process a 50GB file will, obviously, take a lot longer to create than, say, a 5GB file.&lt;/p&gt;
&lt;p&gt;Just one thing to consider before taking this approach.&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;
</description></item><item><title>re: Revisiting the transaction batch size</title><link>http://sqlblog.com/blogs/linchi_shea/archive/2010/08/01/revisiting-the-transaction-batch-size.aspx#27538</link><pubDate>Mon, 02 Aug 2010 20:55:55 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:27538</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Hi Linchi,&lt;/p&gt;
&lt;p&gt;I think more testing is in order. Even with plenty of disk space I've had great success in using smaller batch sizes to significantly speed up large operations... I'm not sure what all of the determining factors are--it would be very interesting to figure out a set of best practices for this kind of thing.&lt;/p&gt;
</description></item></channel></rss>