<?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>data page &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/data-page/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sat, 21 Apr 2018 13:55:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL 9.5: BRIN Index Maintenance using brin_summarize_new_values</title>
		<link>https://www.dbrnd.com/2018/04/postgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 21 Apr 2018 16:16:43 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[block range index]]></category>
		<category><![CDATA[brin]]></category>
		<category><![CDATA[data page]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[index maintenance]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[postgresql 9.5]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3957</guid>

					<description><![CDATA[The newly introduced BRIN (Block Range Index) Index is one my favourite index type of RDBMS system like PostgreSQL. The BRIN index is stored the only summary of data pages instead of storing actual key data. It is 10 times faster than the normal BTREE Index. I have already published articles on What is BRIN [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&amp;linkname=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&amp;linkname=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&amp;linkname=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&amp;linkname=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&amp;linkname=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&amp;linkname=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index%2F&#038;title=PostgreSQL%209.5%3A%20BRIN%20Index%20Maintenance%20using%20brin_summarize_new_values" data-a2a-url="https://www.dbrnd.com/2018/04/postgresql-9-5-brin-index-maintenance-using-brin_summarize_new_values-add-new-data-page-in-brin-index/" data-a2a-title="PostgreSQL 9.5: BRIN Index Maintenance using brin_summarize_new_values"></a></p><p>The newly introduced BRIN (Block Range Index) Index is one my favourite index type of RDBMS system like PostgreSQL.</p>
<blockquote><p>The BRIN index is stored the only summary of data pages instead of storing actual key data. It is 10 times faster than the normal BTREE Index.</p></blockquote>
<p>I have already published articles on What is BRIN and How we can implement BRIN in PostgreSQL 9.5.?</p>
<blockquote class="wp-embedded-content" data-secret="4yvTdzYGJr"><p><a href="https://www.dbrnd.com/2016/08/database-theory-what-is-brin-block-range-index-how-is-faster-than-btree-index-horizontal-partition-index/">Database Theory: What is BRIN (Block Range Index), How is faster than BTREE Index</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/08/database-theory-what-is-brin-block-range-index-how-is-faster-than-btree-index-horizontal-partition-index/embed/#?secret=4yvTdzYGJr" data-secret="4yvTdzYGJr" width="600" height="338" title="&#8220;Database Theory: What is BRIN (Block Range Index), How is faster than BTREE Index&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="Xwijd9J7K6"><p><a href="https://www.dbrnd.com/2016/08/postgresql-9-5-introduced-brin-block-range-index-with-detail-performance-test-report-on-6gb-table/">PostgreSQL 9.5: Introduced BRIN &#8211; Block Range Index with Performance Report</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/08/postgresql-9-5-introduced-brin-block-range-index-with-detail-performance-test-report-on-6gb-table/embed/#?secret=Xwijd9J7K6" data-secret="Xwijd9J7K6" width="600" height="338" title="&#8220;PostgreSQL 9.5: Introduced BRIN &#8211; Block Range Index with Performance Report&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>In this post, I am sharing maintenance part of BRIN Index. </p>
<blockquote><p>Database Administrators are doing maintenance of Indexes on a regular basis like Rebuild Index, Reorganize Index, Update Statistics of Indexes. </p></blockquote>
<blockquote><p>But these types of maintenance will not work for BRIN Indexes because BRIN Indexes are not storing any actual data and it stores only a summary of the data page. </p></blockquote>
<blockquote><p>PostgreSQL 9.5 also introduced brin_summarize_new_values() BRIN Index maintenance function.<br />
This function is used to find a new range of pages which are not yet summarized by BRIN Index.</p></blockquote>
<blockquote><p>It performs the table scanning and creates a new summary index tuple for newly added data pages and adds into BRIN Index. It also returns a count of total newly added pages.</p></blockquote>
<p><strong>The syntax is:</strong></p>
<pre class="crayon-plain-tag">SELECT brin_summarize_new_values('BRIN_Index_Name');</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Script to check Newly Allocated Pages to the Table</title>
		<link>https://www.dbrnd.com/2018/02/sql-server-script-to-check-newly-allocated-pages-to-the-table/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 24 Feb 2018 16:16:16 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[data allocation]]></category>
		<category><![CDATA[data page]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[dm_db_partition_stats]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7161</guid>

					<description><![CDATA[In this post, I am sharing a script for checking the newly allocated pages to the table of SQL Server. The use of this script is in very rare condition. If you are doing deep work like monitoring allocation and space management, you will need this kind of script. For example, If you are doing [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F02%2Fsql-server-script-to-check-newly-allocated-pages-to-the-table%2F&#038;title=SQL%20Server%3A%20Script%20to%20check%20Newly%20Allocated%20Pages%20to%20the%20Table" data-a2a-url="https://www.dbrnd.com/2018/02/sql-server-script-to-check-newly-allocated-pages-to-the-table/" data-a2a-title="SQL Server: Script to check Newly Allocated Pages to the Table"></a></p><p>In this post, I am sharing a script for checking the newly allocated pages to the table of SQL Server. </p>
<p>The use of this script is in very rare condition. If you are doing deep work like monitoring allocation and space management, you will need this kind of script. </p>
<p>For example, If you are doing bulk load, data page allocation should be in sequence for better performance. You can use this script for comparing page allocation before and after of Bulk load activity. </p>
<p><strong>Below is a script:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	OBJECT_NAME(p.object_id) AS object_name
	,i.name AS index_name
	,ps.in_row_used_page_count
FROM sys.dm_db_partition_stats ps
JOIN sys.partitions p
       ON ps.partition_id = p.partition_id
JOIN sys.indexes i
       ON p.index_id = i.index_id
       AND p.object_id = i.object_id</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: When records lock, use %%lockres%% to find the page information of records</title>
		<link>https://www.dbrnd.com/2017/03/sql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 04 Mar 2017 16:16:35 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[%%lockres%%]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[data page]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DeadLock]]></category>
		<category><![CDATA[dm_tran_locks]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4689</guid>

					<description><![CDATA[I shared a couple of articles on SQL Server database locking and how to detect a deadlock. Please access few of them. Different ways to detect a deadlock What happens after the Deadlock? I recently found an undocumented function %%lockres%% which we can use to locate the page information of records especially for those records [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&amp;linkname=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&amp;linkname=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&amp;linkname=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&amp;linkname=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&amp;linkname=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&amp;linkname=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records%2F&#038;title=SQL%20Server%3A%20When%20records%20lock%2C%20use%20%25%25lockres%25%25%20to%20find%20the%20page%20information%20of%20records" data-a2a-url="https://www.dbrnd.com/2017/03/sql-server-when-records-lock-use-lockres-to-find-the-page-information-of-records/" data-a2a-title="SQL Server: When records lock, use %%lockres%% to find the page information of records"></a></p><p>I shared a couple of articles on SQL Server database locking and how to detect a deadlock. Please access few of them.</p>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-8-different-ways-to-detect-a-deadlock-in-a-database/" target="_blank">Different ways to detect a deadlock</a></strong><br />
<a href="https://www.dbrnd.com/2016/04/sql-server-what-happens-after-the-deadlock-arise/" target="_blank"><strong>What happens after the Deadlock?</strong></a></p>
<blockquote><p>I recently found an undocumented function <strong>%%lockres%%</strong> which we can use to locate the page information of records especially for those records which hold a Lock.</p></blockquote>
<blockquote><p>It returns a hash value same as like column &#8220;resource_description&#8221; of table sys.dm_tran_locks, but the good thing is you can use it in your SELECT statement and can correlate the column resource_description of table sys.dm_tran_locks.</p></blockquote>
<p>By this way, you can get the exact record, and it&#8217;s page info which currently held by a Lock.</p>
<p>Let me demonstrate this,<br />
<strong>Prerequisites:</strong><br />
Use below article and generate a sample deadlock situation in your database server.</p>
<blockquote class="wp-embedded-content" data-secret="FLnip7cgnO"><p><a href="https://www.dbrnd.com/2016/04/sql-server-t-sql-script-to-generate-a-deadlock-in-a-database/">SQL Server: T-SQL script to generate a DeadLock in a Database</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-t-sql-script-to-generate-a-deadlock-in-a-database/embed/#?secret=FLnip7cgnO" data-secret="FLnip7cgnO" width="600" height="338" title="&#8220;SQL Server: T-SQL script to generate a DeadLock in a Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>Check the result of below query and note down the result of column &#8220;resource_description&#8221;:</strong></p><pre class="crayon-plain-tag">select *from sys.dm_tran_locks</pre><p>
<img loading="lazy" decoding="async" class="alignnone wp-image-4696 size-full" title="SQL Server Deadlock Result" src="https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockResult.png" alt="SQL Server Deadlock Result" width="628" height="272" srcset="https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockResult.png 628w, https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockResult-300x130.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockResult-150x65.png 150w" sizes="auto, (max-width: 628px) 100vw, 628px" /></p>
<p><strong>Use %%lockres%% and SELECT both the tables:</strong><br />
You can easily correlate the result of sys.dm_tran_locks column resource_description and the result of %%lockres%%. You can find an exact record which held by a Lock.</p><pre class="crayon-plain-tag">SELECT %%lockres%% AS RecordPageInfo,* 
FROM tbl_SampleTable_A

SELECT %%lockres%% AS RecordPageInfo,* 
FROM tbl_SampleTable_B</pre><p>
<img loading="lazy" decoding="async" class="alignnone wp-image-4695 size-full" title="SQL Server Deadlock Record Page Info" src="https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockRecordPageInfo.png" alt="SQL Server Deadlock Record Page Info" width="328" height="643" srcset="https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockRecordPageInfo.png 328w, https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockRecordPageInfo-153x300.png 153w, https://www.dbrnd.com/wp-content/uploads/2017/02/SQLServerDeadlockRecordPageInfo-150x294.png 150w" sizes="auto, (max-width: 328px) 100vw, 328px" /></p>
<p>After this exercise, Please COMMIT all your open transactions.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: How the Rows are stored Physically using ctid?</title>
		<link>https://www.dbrnd.com/2016/10/postgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture/</link>
					<comments>https://www.dbrnd.com/2016/10/postgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 10 Oct 2016 16:16:16 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[8kb]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[ctid]]></category>
		<category><![CDATA[data page]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[internal architecture]]></category>
		<category><![CDATA[MVCC]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[row]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3682</guid>

					<description><![CDATA[PostgreSQL stores data into logical equivalent pages. The size of each data page is 8KB. The structure used to store the table is a heap file which also stores header information like: checksum, start of free space, end of free space. It contains a pair of offset &#038; length, which actually points to the actual [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&amp;linkname=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&amp;linkname=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&amp;linkname=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&amp;linkname=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&amp;linkname=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&amp;linkname=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fpostgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture%2F&#038;title=PostgreSQL%3A%20How%20the%20Rows%20are%20stored%20Physically%20using%20ctid%3F" data-a2a-url="https://www.dbrnd.com/2016/10/postgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture/" data-a2a-title="PostgreSQL: How the Rows are stored Physically using ctid?"></a></p><p>PostgreSQL stores data into logical equivalent pages.</p>
<blockquote><p>The size of each data page is 8KB.<br />
The structure used to store the table is a heap file which also stores header information like: checksum, start of free space, end of free space.</p></blockquote>
<p>It contains a pair of offset &#038; length, which actually points to the actual items.</p>
<blockquote><p>Postgres data called immutable row data. These immutable rows are called &#8220;tuples&#8221; in PostgreSQL.<br />
Tuples are uniquely identified by ctid. A ctid conceptually represents the physical disk location for a tuple.</p></blockquote>
<p>Because of MVCC architecture, multiple ctid can describe a single row which sometime degrade the write performance of PostgreSQL.</p>
<blockquote class="wp-embedded-content" data-secret="0WjI0XVz2t"><p><a href="https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/">What is Multi Version Concurrency Control (MVCC)</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/embed/#?secret=0WjI0XVz2t" data-secret="0WjI0XVz2t" width="600" height="338" title="&#8220;What is Multi Version Concurrency Control (MVCC)&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>For example,<br />
When we are updating any data, internally MVCC inserts new version of record and marks old record as dead row.</p></blockquote>
<blockquote><p>This operation requires to create new ctid for new rows, new link for index, remove old link of record.<br />
Yes, this is good to avoid locking issue, but write performance is not that much good.</p></blockquote>
<blockquote><p>A CTIDs are transparent to users, and any user can check table CTID by adding one additional ctid column in any of the table.<br />
PostgreSQL internally creates CTID column for each and every table. </p></blockquote>
<p>For example,</p><pre class="crayon-plain-tag">SELECT CTID,* FROM tbl_Employees;</pre><p> </p>
<p>Execute VACUUM or AUTO-VACUUM is required to increase the overall performance of PostgreSQL which removes the dead rows or old version rows, generated by MVCC architecture. </p>
<blockquote class="wp-embedded-content" data-secret="sBT0nZvWPz"><p><a href="https://www.dbrnd.com/2015/11/postgresql-short-note-on-vacuum-vacuum-full-and-analyze/">PostgreSQL: Short note on VACUUM, VACUUM FULL and ANALYZE</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/postgresql-short-note-on-vacuum-vacuum-full-and-analyze/embed/#?secret=sBT0nZvWPz" data-secret="sBT0nZvWPz" width="600" height="338" title="&#8220;PostgreSQL: Short note on VACUUM, VACUUM FULL and ANALYZE&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/10/postgresql-how-the-rows-are-stored-physically-using-ctid-offset-length-disk-mvcc-internal-storage-architecture/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
