<?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>ctid &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/ctid/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>Sun, 02 Oct 2016 18:33:53 +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: 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 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 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>
