<?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>Page Split - Techyaz.com</title>
	<atom:link href="https://techyaz.com/tag/page-split/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Fri, 01 Jun 2018 12:35:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>Page Split - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Avoid Page Split in SQL Server?</title>
		<link>https://techyaz.com/sql-server/how-to-avoid-page-split-in-sql-server/</link>
					<comments>https://techyaz.com/sql-server/how-to-avoid-page-split-in-sql-server/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Tue, 14 Nov 2017 12:48:59 +0000</pubDate>
				<category><![CDATA[Indexes]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[fill factor]]></category>
		<category><![CDATA[index rebuild]]></category>
		<category><![CDATA[Page Split]]></category>
		<category><![CDATA[SQL Server Indexes]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1130</guid>

					<description><![CDATA[<p>This is very interesting topic. How to Avoid Page Split in SQL Server? Let&#8217;s start with basics. Page split is a resource intensive operation and causes fragmentation that leads to poor performance in terms of increased I/O operations. We should&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/how-to-avoid-page-split-in-sql-server/">How to Avoid Page Split in SQL Server?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is very interesting topic. How to Avoid Page Split in SQL Server? Let&#8217;s start with basics. Page split is a resource intensive operation and causes <a href="https://techyaz.com/sql-server/difference-index-rebuild-reorganize/" target="_blank" rel="noopener">fragmentation</a> that leads to poor performance in terms of increased I/O operations. We should take it seriously if  there are frequent page splits occur and consider to reduce its occurrences.  Here, i will explain how to check Page Split in SQL Server and how to reduce Page Split and its occurrence.</p>
<h3><span style="color: #333399;">What is Page Split?</span></h3>
<p>Whenever you update existing rows with the data that is bigger in size to save on their data page then Page Split operation occur to make space for this new update. Data from existing data page first move to new page that is added during Page Split operation and make room to accommodate new records. That is why this operation is resource intensive and create fragmentation. Page splits only occur when data changes in the database. If you are adding all your data at the end of the table then page split will not occur.</p>
<p>If your fill factor is 100 or 0, it will work in a same way. That means there is no room in leaf level page to accommodate future updates. Setting fill factor value to 0 or 100 will increase page split occurrences.</p>
<h3><span style="color: #333399;">How to Check Page Split in SQL Server?</span></h3>
<p>Here, i will explain how to check page split in SQL Server. Whenever Page split occurs, it will be logged in transaction log file as <strong>LOP_DELETE_SPLIT </strong>operation. We use <em>fn_dblog</em> function to read SQL Server transaction log file. Run below T-SQL code to see all page splits occurrence using transaction log file.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span style="color: #0000ff;">SELECT *
FROM
fn_dblog (NULL, NULL)
WHERE
[Operation] = N'LOP_DELETE_SPLIT'
</span></strong></pre>
<p>You can see LOP_DELETE_SPLIT is logged under operations column. That means it&#8217;s a page split operation.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-1143" src="http://techyaz.com/wp-content/uploads/2017/11/LOP_DELETE_SPLIT.jpg" alt="page split using fn_dblog" width="654" height="347" srcset="https://techyaz.com/wp-content/uploads/2017/11/LOP_DELETE_SPLIT.jpg 654w, https://techyaz.com/wp-content/uploads/2017/11/LOP_DELETE_SPLIT-300x159.jpg 300w" sizes="(max-width: 654px) 100vw, 654px" /></p>
<p><a href="https://www.sqlskills.com/blogs/paul/tracking-page-splits-using-the-transaction-log/" target="_blank" rel="noopener">Paul Randel</a> has given very good sql code to check total number of page splits occurrence. Below is the code you need to run to get this details.</p>
<pre class="brush: sql; title: ; notranslate" title=""><strong><span style="color: #0000ff;">SELECT
[AllocUnitName] AS N'Index',
(CASE [Context]
WHEN N'LCX_INDEX_LEAF' THEN N'Nonclustered'
WHEN N'LCX_CLUSTERED' THEN N'Clustered'
ELSE N'Non-Leaf'
END) AS [SplitType],
COUNT (1) AS [SplitCount]
FROM
fn_dblog (NULL, NULL)
WHERE
[Operation] = N'LOP_DELETE_SPLIT'
GROUP BY [AllocUnitName], [Context];
GO
</span></strong></pre>
<p>You can check total number of page splits are shown for each indexes in below screenshot. Now we will discuss how to avoid page split in SQL Server for such indexes.</p>
<p><img decoding="async" class="aligncenter size-full wp-image-1144" src="http://techyaz.com/wp-content/uploads/2017/11/page-split-occurance.jpg" alt="Total number of page splits" width="553" height="421" srcset="https://techyaz.com/wp-content/uploads/2017/11/page-split-occurance.jpg 553w, https://techyaz.com/wp-content/uploads/2017/11/page-split-occurance-300x228.jpg 300w" sizes="(max-width: 553px) 100vw, 553px" /></p>
<h3><span style="color: #333399;">How to Reduce Page Split Occurrences?</span></h3>
<p>An <a href="https://techyaz.com/sql-server/understanding-sql-server-indexes/" target="_blank" rel="noopener">index</a> that has many random inserts and has very full pages will have an increased number of page splits. This causes more fragmentation and that is very bad for performance. We can reduce page splits by keeping some room in the data pages by setting fill factor value less than 100. The extra bytes on each page will help to minimize page splits caused by extra length in the rows. Read attached article to understand <a href="https://techyaz.com/sql-server/what-should-be-the-best-value-for-fill-factor-in-sql-server/" target="_blank" rel="noopener">the best value for fill factor</a> to avoid such page-split operations.</p>
<p>We can also use <a href="https://techyaz.com/sql-server/difference-index-rebuild-reorganize/" target="_blank" rel="noopener">index rebuild operation</a> with the <a href="https://techyaz.com/sql-server/what-should-be-the-best-value-for-fill-factor-in-sql-server/" target="_blank" rel="noopener">FILL FACTOR</a> option that will allow the page fullness to be changed to fit the query pattern on the index. This will also helpful in reducing total page-split counts.<br />
I hope you like this article. You can drop your questions in comment section. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/sql-server/how-to-avoid-page-split-in-sql-server/">How to Avoid Page Split in SQL Server?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/how-to-avoid-page-split-in-sql-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
