<?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>Tablespace &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/tablespace/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, 17 Dec 2017 00:48:31 +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 to Create and Use Tablespace?</title>
		<link>https://www.dbrnd.com/2017/12/postgresql-how-to-create-and-use-tablespace-pg_global-pg_default/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 21 Dec 2017 16:16:21 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[pg_default]]></category>
		<category><![CDATA[pg_global]]></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 Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[postgresql tablespace]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[Tablespace]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6876</guid>

					<description><![CDATA[As DBA and Architect, Database Tablespace is a most important thing for storage optimization. In this post, I am sharing my understanding of the PostgreSQL Tablespace. A tablespace is a defined disk space location for storing the database metadata and user data. The default tablespaces are pg_global and pg_default. The pg_global tablespace is used for [&#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%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%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%2F2017%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%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%2F2017%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%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%2F2017%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%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%2F2017%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%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%2F2017%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%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%2F2017%2F12%2Fpostgresql-how-to-create-and-use-tablespace-pg_global-pg_default%2F&#038;title=PostgreSQL%3A%20How%20to%20Create%20and%20Use%20Tablespace%3F" data-a2a-url="https://www.dbrnd.com/2017/12/postgresql-how-to-create-and-use-tablespace-pg_global-pg_default/" data-a2a-title="PostgreSQL: How to Create and Use Tablespace?"></a></p><p>As DBA and Architect, Database Tablespace is a most important thing for storage optimization. </p>
<p>In this post, I am sharing my understanding of the PostgreSQL Tablespace.</p>
<p>A tablespace is a defined disk space location for storing the database metadata and user data. The default tablespaces are pg_global and pg_default. The pg_global tablespace is used for shared system catalogs and pg_default is the default for other databases. </p>
<p><strong>Few advantages in short:</strong></p>
<blockquote><p>Can move important database metadata in a high-speed disk-like SSD Type</p>
<p>Can move important tables and indexes in a high-speed disk-like SSD Type</p>
<p>Can move temp tables and temp indexes in a sperate disk for better performance</p>
<p>Can manage and take the backup very easily</p>
<p>Not require to depend on one single disk block, and even single/default disk block/partition has also size limitation </p></blockquote>
<p><strong>Create a TABLESPACE:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLESPACE dbrnd LOCATION 'd:\';</pre> </p>
<p><strong>Create a new table in specific tablespace:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_test(rno int) TABLESPACE dbrnd;</pre> </p>
<p><strong>Change the default tablespace:</strong></p>
<pre class="crayon-plain-tag">SET default_tablespace = dbrnd;</pre> </p>
<p><strong>Now, try to create another table which will create in newly created tablespace:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_test2(rno int);</pre> </p>
<p><strong>Check the list of tablespaces:</strong></p>
<pre class="crayon-plain-tag">SELECT spcname FROM pg_tablespace;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Greenplum: Script to check Tablespace and Filespace information</title>
		<link>https://www.dbrnd.com/2017/07/greenplum-script-to-check-tablespace-and-filespace-information/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 28 Jul 2017 16:16:08 +0000</pubDate>
				<category><![CDATA[Greenplum]]></category>
		<category><![CDATA[Greenplum DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Greenplum Administrator]]></category>
		<category><![CDATA[Greenplum Error]]></category>
		<category><![CDATA[Greenplum Monitoring]]></category>
		<category><![CDATA[Greenplum Performance Tuning]]></category>
		<category><![CDATA[Greenplum Programming]]></category>
		<category><![CDATA[Greenplum Query]]></category>
		<category><![CDATA[Greenplum Tips and Tricks]]></category>
		<category><![CDATA[pg_tablespace]]></category>
		<category><![CDATA[PostgreSQL 8.2]]></category>
		<category><![CDATA[Tablespace]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5713</guid>

					<description><![CDATA[In this post, I am sharing a script to check the Tablespace and Filespace information in Greenplum. In a big database system, DBAs are creating different tablespaces for storage purpose so using below script we can get the information of tablespaces. [crayon-6ab51d9858a9e554007757/]]]></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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&amp;linkname=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" 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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&amp;linkname=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" 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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&amp;linkname=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" 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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&amp;linkname=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" 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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&amp;linkname=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" 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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&amp;linkname=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" 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%2F07%2Fgreenplum-script-to-check-tablespace-and-filespace-information%2F&#038;title=Greenplum%3A%20Script%20to%20check%20Tablespace%20and%20Filespace%20information" data-a2a-url="https://www.dbrnd.com/2017/07/greenplum-script-to-check-tablespace-and-filespace-information/" data-a2a-title="Greenplum: Script to check Tablespace and Filespace information"></a></p><p>In this post, I am sharing a script to check the Tablespace and Filespace information in Greenplum.</p>
<p>In a big database system, DBAs are creating different tablespaces for storage purpose so using below script we can get the information of tablespaces.</p>
<pre class="crayon-plain-tag">SELECT
	spcname as tblspc
	,fsname as filespc
	,fsedbid as seg_dbid
	,fselocation as datadir
FROM pg_tablespace pgts
	,pg_filespace pgfs
	,pg_filespace_entry pgfse
WHERE pgts.spcfsoid=pgfse.fsefsoid
AND pgfse.fsefsoid=pgfs.oid
ORDER BY tblspc, seg_dbid</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Create or Change default Tablespace of Table to Migrate on SSD</title>
		<link>https://www.dbrnd.com/2016/09/postgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance/</link>
					<comments>https://www.dbrnd.com/2016/09/postgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 11 Sep 2016 19:45:12 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[disk performance]]></category>
		<category><![CDATA[pg_default]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[postgres hard drive]]></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[SSD]]></category>
		<category><![CDATA[Tablespace]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3629</guid>

					<description><![CDATA[My Problem: In our Windows based PostgreSQL Server, We were facing Hard disk related performance issue. Later, we decided to move some of our main tables on SSD Hard Disk (Solid State Drive). The Performance of SSD Hard drive is 10 times faster than normal HDD Disk. The Solution: First, We have to create new [&#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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&amp;linkname=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" 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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&amp;linkname=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" 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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&amp;linkname=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" 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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&amp;linkname=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" 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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&amp;linkname=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" 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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&amp;linkname=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" 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%2F09%2Fpostgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance%2F&#038;title=PostgreSQL%3A%20Create%20or%20Change%20default%20Tablespace%20of%20Table%20to%20Migrate%20on%20SSD" data-a2a-url="https://www.dbrnd.com/2016/09/postgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance/" data-a2a-title="PostgreSQL: Create or Change default Tablespace of Table to Migrate on SSD"></a></p><p><strong>My Problem: </strong></p>
<blockquote><p>In our Windows based PostgreSQL Server, We were facing Hard disk related performance issue. Later, we decided to move some of our main tables on SSD Hard Disk (Solid State Drive).</p></blockquote>
<blockquote><p>The Performance of SSD Hard drive is 10 times faster than normal HDD Disk.</p></blockquote>
<p><strong>The Solution:</strong></p>
<blockquote><p>First, We have to create new Tablespace on SSD disk. The pg_default is a default Tablespace in PostgreSQL. A Tablespace contains all Table information and data. </p></blockquote>
<blockquote><p>In PostgreSQL, We can create a new Tablespace or we can also alter Tablespace for existing Tables.<br />
We can perform this exercise using both PGAdmin tool and Script.</p></blockquote>
<p>In below example, I am creating and changing Tablespace using script. </p>
<p><strong>The Syntax of CREATE TABLESPACE:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLESPACE tablespace_name
OWNER user_name
LOCATION directory_path;</pre> </p>
<p><strong>Create a sample Tablespace:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLESPACE dbrnd
OWNER postgres
LOCATION 'E:\temp\dbrnd';</pre> </p>
<p><strong>Create a new table under newly created Tablespace:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_Students
(Rno INT, Name CHARACTER VARYING)
TABLESPACE dbrnd;</pre> </p>
<p><strong>We can also change default Tablespace:</strong><br />
After this change, all your newly table can create under dbrnd Tablespace. </p>
<pre class="crayon-plain-tag">SET default_tablespace = dbrnd;</pre> </p>
<p><strong>Create one more table and test this:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_Employee
(Eno INT, Name CHARACTER VARYING);</pre> </p>
<p><strong>Change Tablespace of existing Table:</strong></p>
<pre class="crayon-plain-tag">ALTER TABLE tbl_Employee SET TABLESPACE pg_default;</pre> </p>
<p><strong>Check all Tablespace of your PostgreSQL Database Server:</strong></p>
<pre class="crayon-plain-tag">SELECT spcname FROM pg_tablespace;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/09/postgresql-create-or-change-default-tablespace-of-table-to-migrate-on-ssd-solid-state-drive-better-performance/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
