<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Edwin M SarmientoPartition-Level Online Index Operations in SQL Server 2014 and its Impact in HA/DR &#8211; Edwin M Sarmiento</title>
	<atom:link href="https://www.edwinmsarmiento.com/partition-level-online-index-operations-in-sql-server-2014-and-its-impact-in-hadr/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.edwinmsarmiento.com</link>
	<description>Intentional Excellence</description>
	<lastBuildDate>Sun, 19 Jul 2026 15:09:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">84283043</site>		<item>
		<title>Partition-Level Online Index Operations in SQL Server 2014 and its Impact in HA/DR</title>
		<link>https://www.edwinmsarmiento.com/partition-level-online-index-operations-in-sql-server-2014-and-its-impact-in-hadr/</link>
		<comments>https://www.edwinmsarmiento.com/partition-level-online-index-operations-in-sql-server-2014-and-its-impact-in-hadr/#respond</comments>
		<pubDate>Mon, 15 Jun 2015 01:16:44 +0000</pubDate>
		<dc:creator>Edwin M Sarmiento</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[online index operation]]></category>
		<category><![CDATA[single partition online index rebuild]]></category>
		<category><![CDATA[SQL Server 2014]]></category>
		<guid isPermaLink="false">http://www.edwinmsarmiento.com/?p=1685</guid>

				<description><![CDATA[One of the cool features introduced in SQL Server 2014 was the ability to perform an online index rebuild of a single partition. Prior to SQL Server 2014, the only way to rebuild indexes for a partitioned table was to do it on all of the partitions (or, simply put, rebuild the entire index on [&#8230;]]]></description>
					<content:encoded><![CDATA[<img width="608" height="510" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2.jpg" class="featured-image wp-post-image" alt="" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2.jpg 608w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-300x252.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-477x400.jpg 477w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-82x69.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-600x503.jpg 600w" sizes="(max-width: 608px) 100vw, 608px" /><p>One of the cool features introduced in SQL Server 2014 was the ability to perform an online index rebuild of a single partition. Prior to SQL Server 2014, the only way to rebuild indexes for a partitioned table was to do it on all of the partitions (or, simply put, rebuild the entire index on the table similar to how you would do it if the table wasn&#8217;t partitioned.) If you wanted to rebuild only one partition, the only option was to do it offline. In fact, if you rebuild an index on a partitioned table, compare the syntax and result with using the <strong>ALL</strong> keyword (rebuilding index on all partitions) versus just one of the partitions, you get a slightly confusing error message (the error message below is from a SQL Server 2008 R2 instance.)</p>
<div style="background-color:#eeeeee;border:1px solid #D6D6D6;font-family:arial,helvetica,sans-serif;font-size:15px;line-height:20px;margin:8px 0 20px;padding:15px 20px;"><code style="font-size: 14px;"><span style="color: blue;">ALTER INDEX </span><span style="color: black;">[PK_Order_Details]<br />
</span><span style="color: blue;">ON </span><span style="color: black;">[dbo].[Order Details]<br />
REBUILD PARTITION </span><span style="color: blue;">= </span><span style="color: gray;">ALL<br />
</span><span style="color: blue;">WITH </span><span style="color: gray;">(</span><span style="color: black;">ONLINE</span><span style="color: blue;">= ON</span><span style="color: gray;">);<br />
</span><span style="color: black;">GO</span></code></p>
<p><code style="font-size: 14px;"><span style="color: black;">Command(s) completed successfully.</span></code></p>
<p><code style="font-size: 14px;"><span style="color: blue;">ALTER INDEX </span><span style="color: black;">[PK_Order_Details]<br />
</span><span style="color: blue;">ON </span><span style="color: black;">[dbo].[Order Details]<br />
REBUILD PARTITION </span><span style="color: blue;">= </span><span style="color: black;">1<br />
</span><span style="color: blue;">WITH </span><span style="color: gray;">(</span><span style="color: black;">ONLINE</span><span style="color: blue;">= ON</span><span style="color: gray;">);<br />
</span><span style="color: black;">GO</span></code></p>
<p><span style="color: #ff0000;"><code style="font-size: 14px;">Msg 155, Level 15, State 1, Line 4<br />
'ONLINE' is not a recognized ALTER INDEX REBUILD PARTITION option.</code></span> </div>
<p>It may seem that, from the error message, the ONLINE option is not a valid keyword which may prompt you to use <span style="color: #0000ff;">ONLINE=OFF <span style="color: #000000;">because <strong>ONLINE=ON</strong> worked with <strong>REBUILD PARTITION = ALL</strong></span></span>. It turns out that you just can&#8217;t do a single partition index rebuild while keeping the partition online.</p>
<h3>New Feature? Check</h3>
<p>There have been several blog posts and articles written about this feature, most of which focus on increased availability of the partitioned table during index operations. For one, if you&#8217;re partitioning your table, it means that the table is very large. Making sure that the table is accessible during normal operations factor into your database availability. But that&#8217;s already a given if you simply look at the name of the feature &#8211; <span style="color: #800000;">Partition-Level <strong>ONLINE</strong> Index Operation</span>. There&#8217;s a reason that the marketing folks used the word <span style="color: #0000ff;"><strong>ONLINE</strong></span>.</p>
<p>But beyond the benefit of keeping the partitioned table online during index maintenance, I wanted to focus more on it&#8217;s overall impact to high availability and disaster recovery. If this table is mission-critical, I would assume that there is some form of HA/DR features like Availability Groups, Log Shipping, Failover Clustering, Replication, etc. implemented with it. I&#8217;ll refer back to my blog post on <a href="https://www.edwinmsarmiento.com/data-types-and-how-they-affect-hadr/" target="_blank">Data Types and How They Affect HA/DR</a> to explain further.</p>
<p>Online index operations are fully logged from SQL Server 2008 and higher versions.This behavior is described in <a href="https://support.microsoft.com/en-us/kb/2407439" target="_blank">Microsoft KB article 2407439</a>. This means that when you rebuild an index, the database engine needs to track all of the activities involved in the index operation to make sure that it is kept consistent should anything happen to the database during this process (imagine that your server accidentally rebooted while running an index operation.) This also means that rebuilding an index for a very large partitioned table would generate a very large amount or transaction log records. Having the ability to perform online index operations on specific partitions not only allows us to keep the table available, it also reduces the amount of transaction log records generated while doing so. How cool is that?</p>
<h3>Measuring and Comparing Transaction Log Records Generated</h3>
<p>For testing, I <span style="color: #800000;">*<em>stole</em>*</span> the scripts used in this article <a href="http://www.mssqltips.com/sqlservertip/1621/sql-server-partitioned-tables-with-multiple-filegroups-for-high-availability/" target="_blank">SQL Server Partitioned Tables with Multiple Filegroups for High Availability</a>. Use the Northwind database and run the script below to setup the test environment.</p>
<div style="background-color:#eeeeee;border:1px solid #D6D6D6;font-family:arial,helvetica,sans-serif;font-size:15px;line-height:20px;margin:8px 0 20px;padding:15px 20px;"><code style="font-size: 14px;"><span style="color: blue;">USE </span><span style="color: black;">Northwind<br />
GO</span></code></p>
<p><span style="color: green;">&#8211;Add the first filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition1<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add a database file to the first filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD FILE<br />
</span><span style="color: gray;">(  </span><span style="color: black;">NAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;NorthwindOrderDetailsDataPartition1&#8242;<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILENAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;C:\DBFiles\NorthwindOrderDetailsDataPartition1.ndf&#8217;<br />
</span><span style="color: gray;">, </span><span style="color: black;">SIZE </span><span style="color: blue;">= </span><span style="color: black;">10<br />
</span><span style="color: gray;">, </span><span style="color: black;">MAXSIZE </span><span style="color: blue;">= </span><span style="color: black;">120<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILEGROWTH </span><span style="color: blue;">= </span><span style="color: black;">10</span><span style="color: gray;">)<br />
</span><span style="color: blue;">TO </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition1<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add the second filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition2<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add a database file to the second filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD FILE<br />
</span><span style="color: gray;">(  </span><span style="color: black;">NAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;NorthwindOrderDetailsDataPartition2&#8242;<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILENAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;C:\DBFiles\NorthwindOrderDetailsDataPartition2.ndf&#8217;<br />
</span><span style="color: gray;">, </span><span style="color: black;">SIZE </span><span style="color: blue;">= </span><span style="color: black;">10<br />
</span><span style="color: gray;">, </span><span style="color: black;">MAXSIZE </span><span style="color: blue;">= </span><span style="color: black;">120<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILEGROWTH </span><span style="color: blue;">= </span><span style="color: black;">10</span><span style="color: gray;">)<br />
</span><span style="color: blue;">TO </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition2<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add the third filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition3<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add a database file to the third filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD FILE<br />
</span><span style="color: gray;">(  </span><span style="color: black;">NAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;NorthwindOrderDetailsDataPartition3&#8242;<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILENAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;C:\DBFiles\NorthwindOrderDetailsDataPartition3.ndf&#8217;<br />
</span><span style="color: gray;">, </span><span style="color: black;">SIZE </span><span style="color: blue;">= </span><span style="color: black;">10<br />
</span><span style="color: gray;">, </span><span style="color: black;">MAXSIZE </span><span style="color: blue;">= </span><span style="color: black;">120<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILEGROWTH </span><span style="color: blue;">= </span><span style="color: black;">10</span><span style="color: gray;">)<br />
</span><span style="color: blue;">TO </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition3<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add the fourth filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">Northwind<br />
</span><span style="color: blue;">ADD </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition4<br />
GO</span></p>
<p><span style="color: green;">&#8211;Add a database file to the fourth filegroup<br />
</span><span style="color: blue;">ALTER DATABASE </span><span style="color: black;">[Northwind]<br />
</span><span style="color: blue;">ADD FILE<br />
</span><span style="color: gray;">(  </span><span style="color: black;">NAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;NorthwindOrderDetailsDataPartition4&#8242;<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILENAME </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;C:\DBFiles\NorthwindOrderDetailsDataPartition4.ndf&#8217;<br />
</span><span style="color: gray;">, </span><span style="color: black;">SIZE </span><span style="color: blue;">= </span><span style="color: black;">10<br />
</span><span style="color: gray;">, </span><span style="color: black;">MAXSIZE </span><span style="color: blue;">= </span><span style="color: black;">120<br />
</span><span style="color: gray;">, </span><span style="color: black;">FILEGROWTH </span><span style="color: blue;">= </span><span style="color: black;">10</span><span style="color: gray;">)<br />
</span><span style="color: blue;">TO </span><span style="color: black;">FILEGROUP NorthwindOrderDetailsDataPartition4<br />
GO</span></p>
<p><span style="color: green;">&#8211;Create the partition function for the partitioned table<br />
</span><span style="color: blue;">CREATE </span><span style="color: black;">PARTITION </span><span style="color: blue;">FUNCTION </span><span style="color: black;">OrderDetails4Partitions_PFN</span><span style="color: gray;">(</span><span style="color: blue;">INT</span><span style="color: gray;">)<br />
</span><span style="color: blue;">AS<br />
</span><span style="color: black;">RANGE </span><span style="color: magenta;">RIGHT </span><span style="color: blue;">FOR VALUES </span><span style="color: gray;">(</span><span style="color: black;">10000</span><span style="color: gray;">,</span><span style="color: black;">10500</span><span style="color: gray;">,</span><span style="color: black;">10750</span><span style="color: gray;">)<br />
</span><span style="color: black;">GO</span></p>
<p><span style="color: green;">&#8211;Create the partition scheme to map the partition function to the filegroups</span></p>
<p><span style="color: blue;">CREATE </span><span style="color: black;">PARTITION SCHEME [OrderDetails4Partitions_PS]<br />
</span><span style="color: blue;">AS<br />
</span><span style="color: black;">PARTITION [OrderDetails4Partitions_PFN] </span><span style="color: blue;">TO<br />
</span><span style="color: gray;">(</span><span style="color: black;">NorthwindOrderDetailsDataPartition1</span><span style="color: gray;">, </span><span style="color: black;">NorthwindOrderDetailsDataPartition2</span><span style="color: gray;">,<br />
</span><span style="color: black;">NorthwindOrderDetailsDataPartition3</span><span style="color: gray;">, </span><span style="color: black;">NorthwindOrderDetailsDataPartition4 </span><span style="color: gray;">)<br />
</span><span style="color: black;">GO</span></p>
<p><span style="color: green;">&#8211;Rebuild the index to partition the table</span></p>
<p><span style="color: blue;">IF  </span><span style="color: gray;">EXISTS (</span><span style="color: blue;">SELECT </span><span style="color: gray;">* </span><span style="color: blue;">FROM </span><span style="color: black;">sys.indexes<br />
</span><span style="color: blue;">WHERE </span><span style="color: magenta;">OBJECT_ID </span><span style="color: blue;">= </span><span style="color: magenta;">OBJECT_ID</span><span style="color: gray;">(</span><span style="color: red;">N'[dbo].[Order Details]&#8217;</span><span style="color: gray;">)<br />
AND </span><span style="color: black;">name </span><span style="color: blue;">= </span><span style="color: red;">N&#8217;PK_Order_Details&#8217;</span><span style="color: gray;">)<br />
</span><span style="color: blue;">ALTER TABLE </span><span style="color: black;">[dbo].[Order Details] </span><span style="color: blue;">DROP CONSTRAINT </span><span style="color: black;">[PK_Order_Details]<br />
GO</span></p>
<p><span style="color: blue;">ALTER TABLE </span><span style="color: black;">[dbo].[Order Details]<br />
</span><span style="color: blue;">ADD  CONSTRAINT </span><span style="color: black;">[PK_Order_Details] </span><span style="color: blue;">PRIMARY KEY CLUSTERED<br />
</span><span style="color: gray;">(<br />
</span><span style="color: black;">[OrderID] </span><span style="color: blue;">ASC</span><span style="color: gray;">,<br />
</span><span style="color: black;">[ProductID] </span><span style="color: blue;">ASC<br />
</span><span style="color: gray;">)</span><span style="color: blue;">WITH </span><span style="color: gray;">(</span><span style="color: black;">ONLINE </span><span style="color: blue;">= OFF</span><span style="color: gray;">) </span><span style="color: blue;">ON </span><span style="color: black;">[OrderDetails4Partitions_PS] </span><span style="color: gray;">(</span><span style="color: black;">OrderID</span><span style="color: gray;">)<br />
</span><span style="color: green;">&#8211;we pass the partition scheme name and the partitioning column<br />
</span><span style="color: black;">GO</span></p>
<p></div>
<p>Once you&#8217;ve setup the database for testing, let&#8217;s start using the partition-level online index operation and measure the amount of transaction log records generated in the process. The code sample below displays the amount of transaction log records generated by rebuilding the index on all partitions on the table, similar to rebuilding the index on a non-partitioned table. I&#8217;m only rolling back the transaction so I can repeat the process. You certainly don&#8217;t want to do this on a production system. Note, also, that the Northwind sample database is a very small database.</p>
<div style="background-color:#eeeeee;border:1px solid #D6D6D6;font-family:arial,helvetica,sans-serif;font-size:15px;line-height:20px;margin:8px 0 20px;padding:15px 20px;"><code style="font-size: 14px;"><span style="color: blue;">BEGIN TRAN</span><span style="color: gray;">;<br />
</span><span style="color: blue;">USE </span><span style="color: black;">Northwind<br />
GO<br />
</span><span style="color: blue;">ALTER INDEX </span><span style="color: black;">[PK_Order_Details]<br />
</span><span style="color: blue;">ON </span><span style="color: black;">[dbo].[Order Details]<br />
<strong>REBUILD PARTITION </strong></span><strong><span style="color: blue;">= </span></strong><span style="color: gray;"><strong>ALL</strong><br />
</span><span style="color: blue;">WITH </span><span style="color: gray;">(</span><span style="color: black;">ONLINE</span><span style="color: blue;">= ON</span><span style="color: gray;">);<br />
</span><span style="color: black;">GO<br />
</span><span style="color: blue;">SELECT </span><span style="color: black;">[database_transaction_log_bytes_used]<br />
</span><span style="color: blue;">FROM </span><span style="color: black;">sys.dm_tran_database_transactions<br />
</span><span style="color: blue;">WHERE </span><span style="color: black;">[database_id] </span><span style="color: blue;">= </span><span style="color: magenta;">DB_ID </span><span style="color: gray;">(</span><span style="color: red;">N'Northwind'</span><span style="color: gray;">);<br />
</span><span style="color: black;">GO<br />
</span><span style="color: blue;">ROLLBACK TRAN<br />
</span><span style="color: black;">GO</span></code> </div>
<p><a href="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1.jpg"><img fetchpriority="high" decoding="async" class=" size-full wp-image-1704 aligncenter" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1.jpg" alt="SPOIR1" width="611" height="527" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1.jpg 611w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1-300x259.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1-464x400.jpg 464w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1-82x71.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR1-600x518.jpg 600w" sizes="(max-width: 611px) 100vw, 611px" /></a></p>
<p>&nbsp;</p>
<p>Rebuilding the clustered index <strong>PK_Order_Details</strong> on the entire table (or on all of the partitions) generated <strong>32.39 KB</strong>. Let&#8217;s try rebuilding the index on one of the partitions.</p>
<div style="background-color:#eeeeee;border:1px solid #D6D6D6;font-family:arial,helvetica,sans-serif;font-size:15px;line-height:20px;margin:8px 0 20px;padding:15px 20px;"><code style="font-size: 14px;"><span style="color: blue;">BEGIN TRAN</span><span style="color: gray;">;<br />
</span><span style="color: blue;">USE </span><span style="color: black;">Northwind<br />
GO<br />
</span><span style="color: blue;">ALTER INDEX </span><span style="color: black;">[PK_Order_Details]<br />
</span><span style="color: blue;">ON </span><span style="color: black;">[dbo].[Order Details]<br />
<strong>REBUILD PARTITION </strong></span><strong><span style="color: blue;">= </span></strong><span style="color: black;"><strong>1</strong><br />
</span><span style="color: blue;">WITH </span><span style="color: gray;">(</span><span style="color: black;">ONLINE</span><span style="color: blue;">= ON</span><span style="color: gray;">);<br />
</span><span style="color: black;">GO<br />
</span><span style="color: blue;">SELECT </span><span style="color: black;">[database_transaction_log_bytes_used]<br />
</span><span style="color: blue;">FROM </span><span style="color: black;">sys.dm_tran_database_transactions<br />
</span><span style="color: blue;">WHERE </span><span style="color: black;">[database_id] </span><span style="color: blue;">= </span><span style="color: magenta;">DB_ID </span><span style="color: gray;">(</span><span style="color: red;">N'Northwind'</span><span style="color: gray;">);<br />
</span><span style="color: black;">GO<br />
</span><span style="color: blue;">ROLLBACK TRAN<br />
</span><span style="color: black;">GO</span></code></div>
<p><a href="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2.jpg"><img decoding="async" class=" size-full wp-image-1705 aligncenter" src="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2.jpg" alt="SPOIR2" width="608" height="510" srcset="https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2.jpg 608w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-300x252.jpg 300w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-477x400.jpg 477w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-82x69.jpg 82w, https://www.edwinmsarmiento.com/wp-content/uploads/2015/06/SPOIR2-600x503.jpg 600w" sizes="(max-width: 608px) 100vw, 608px" /></a></p>
<p>&nbsp;</p>
<p>By simply choosing to rebuild the index of only a portion of the table, we&#8217;ve not only increased the availability of the table by performing the index operation online but also reduced the amount of transaction log records generated. Imagine having to deal with a very large table with several partitions. You&#8217;re literally saving a large amount of transaction log records generated that will get sent to the Availability Group replicas, stored on backups, read during the recovery phase, and so on.</p>
<h3>Try It Out</h3>
<p>If you already have a partitioned table and running on SQL Server 2014, modify your existing index maintenance scripts by specifying which partitions to perform maintenance on. You can always check which partitions are highly fragmented and focus your index maintenance efforts on them. You can measure the before-and-after effects of the changes you made by looking at the size of the transaction log backups. You&#8217;re definitely going to increase your availability and save some storage along the way.</p>
<h4>Additional Resources</h4>
<ul>
<li><a href="http://sqlperformance.com/2013/09/sql-indexes/partition-index-ops-sql2014" target="_blank">Exploring Partition-Level Online Index Operations in SQL Server 2014 CTP1</a></li>
<li><a href="http://sqlserver-help.com/2014/06/26/sql-2014-learning-series-16-new-feature-single-partition-online-index-rebuild-spoir/" target="_blank">SQL 2014 Learning Series # 16 – New Feature – Single Partition Online Index Rebuild (SPOIR)</a></li>
<li><a href="http://blogs.technet.com/b/dataplatforminsider/archive/2013/08/16/improved-application-availability-during-online-operations-in-sql-server-2014.aspx" target="_blank">Improved Application Availability During Online Operations in SQL Server 2014</a></li>
</ul>
]]></content:encoded>
			

		<wfw:commentRss>https://www.edwinmsarmiento.com/partition-level-online-index-operations-in-sql-server-2014-and-its-impact-in-hadr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
				<post-id xmlns="com-wordpress:feed-additions:1">1685</post-id>	</item>
	</channel>
</rss>