<?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>The CANDIS Blog &#187; postgresql</title>
	<atom:link href="http://www.candisgroup.com/blog/tag/postgresql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.candisgroup.com/blog</link>
	<description>Your IT Gateway with China</description>
	<lastBuildDate>Mon, 16 Aug 2010 17:52:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PostgreSQL Re-Index, Index Corruption</title>
		<link>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-re-index-index-corruption</link>
		<comments>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-re-index-index-corruption#comments</comments>
		<pubDate>Mon, 03 Dec 2007 14:18:25 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Enterprise Hardware]]></category>
		<category><![CDATA[FOSS/GNU/Linux]]></category>
		<category><![CDATA[big iron]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[reindex]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.utilitycomputing.com.cn/?p=127</guid>
		<description><![CDATA[Ever had a situation like this: Select from database ID where name = RICHARD; Returns and ID of 55 for example. Then go and do a query like this: Select * from some_other_table where ID = 55; Returns, &#8220;Sorry does not exist, time to die&#8230;..&#8221; Well apparently indexes when corrupt &#8211; which is NOT SUPPOSED [...]]]></description>
			<content:encoded><![CDATA[<p>Ever had a situation like this:</p>
<p>Select from database ID where name = RICHARD;</p>
<p>Returns and ID of 55 for example.</p>
<p>Then go and do a query like this:</p>
<p>Select * from some_other_table where ID = 55;</p>
<p>Returns, &#8220;Sorry does not exist, time to die&#8230;..&#8221;</p>
<p>Well apparently indexes when corrupt &#8211; which is NOT SUPPOSED TO HAPPEN &#8211; can cause PostgreSQL to go all stupid and not do a table lookup for real.  This happened to me.  So I found this:</p>
<p><a href="http://people.planetpostgresql.org/greg/index.php?/archives/88-Performing-a-reindex-of-the-system-tables.html">PlanetPostgresql </a></p>
<p>Turns out that a reindex and a full vacuum can do wonders &#8211; even though a full vacuum is not needed with autovacuum and indexes can&#8217;t get corrupted&#8230;..or so they say.</p>
<p>I have now added a system wide reindex maintenance plan for PostgreSQL every night.  I know that MS-SQL server has an option for this with their maintenance jobs inside enterprise manager.  Maybe someone should make an enterprise manager for PostgreSQL too?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-re-index-index-corruption/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drive Roaming.  DELL PERC4 Controllers</title>
		<link>http://www.candisgroup.com/blog/enterprise-hardware/drive-roaming-dell-perc4-controllers</link>
		<comments>http://www.candisgroup.com/blog/enterprise-hardware/drive-roaming-dell-perc4-controllers#comments</comments>
		<pubDate>Sun, 18 Nov 2007 15:31:28 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Enterprise Hardware]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[big iron]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.utilitycomputing.com.cn/?p=124</guid>
		<description><![CDATA[During a recent test run to see if a new PostgreSQL back end server would hasten things up in a main cluster &#8211; that has now become CPU bound and NOT IO&#8230;&#8230; the wizardry of that I will blog about later. In any case, the short of it is, that we were juggling PERC4 cards [...]]]></description>
			<content:encoded><![CDATA[<p>During a recent test run to see if a new PostgreSQL back end server would hasten things up in a main cluster &#8211; that has now become CPU bound and NOT IO&#8230;&#8230; the wizardry of that I will blog about later.</p>
<p>In any case, the short of it is, that we were juggling PERC4 cards around servers (PCI-X here, PCIe there..) and also complete raid 1 and raid 10 arrays too.  The cards are supposed to &#8220;detect&#8221; the correct array type from the drives if the firmware was missing.  Anyway, through a comedy of errors, it worked exactly 1/3 times.  The other times we had to remember the exact settings of our arrays (stripe, etc) and how it was structured.  So we could clear PERC cards and then recreate the arrays &#8211; taking special care to not initalise the new arrays.</p>
<p>So in the end, you can move arrays and channels about.  And with LVM, even designations like /sda /sdb reording is also not an issue.  However you should rely on good old fashioned hand held way of doing things.  Before you start write down all the salient details of your arrays first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.candisgroup.com/blog/enterprise-hardware/drive-roaming-dell-perc4-controllers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Verdict Is In!</title>
		<link>http://www.candisgroup.com/blog/cloud/the-verdict-is-in</link>
		<comments>http://www.candisgroup.com/blog/cloud/the-verdict-is-in#comments</comments>
		<pubDate>Mon, 03 Sep 2007 15:49:49 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Enterprise Hardware]]></category>
		<category><![CDATA[FOSS/GNU/Linux]]></category>
		<category><![CDATA[The Cloud]]></category>
		<category><![CDATA[big iron]]></category>
		<category><![CDATA[China]]></category>
		<category><![CDATA[idc]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.utilitycomputing.com.cn/?p=51</guid>
		<description><![CDATA[Excellent Results! CPU System load was DOWN. This is due to much better disk IO (reduced wait times) and as such, user processes get to breath and send stuff back to clients in a speedy fashion. LOAD Load being a matrix balanced scorecard measurement over various metrics is also down considerably. The trend to take [...]]]></description>
			<content:encoded><![CDATA[<p>Excellent Results!</p>
<p><strong>CPU</strong></p>
<p><a title="CPU" href="http://202.177.13.171/blog/wp-content/uploads/2007/09/cpu.png"><img src="http://202.177.13.171/blog/wp-content/uploads/2007/09/cpu.png" alt="CPU" width="441" height="196" /> </a></p>
<p>System load was <em>DOWN</em>.  This is due to much better disk IO (reduced wait times) and as such, user processes get to breath and send stuff back to clients in a speedy fashion.</p>
<p><span id="more-51"></span><strong>LOAD</strong></p>
<p><a title="Direct link to file" onclick="return false;" href="http://202.177.13.171/blog/wp-content/uploads/2007/09/load.png"><img src="http://202.177.13.171/blog/wp-content/uploads/2007/09/load.png" alt="LOAD" width="442" height="199" /> </a></p>
<p>Load being a matrix balanced scorecard measurement over various metrics is also down considerably.  The trend to take note of here is the 15min average more than the 1 min average.  While spikes and load increases over short periods may upset some users experience.  If the delays compound and extend over a longer time frame, you will be tying up more people in the slowdown.  Again, this is leading a bit to the parallel vs serial arguments.  And in the case of a database, sometimes fewer &#8216;in and out&#8217; transactions give a better user experience over time because more gets done in a given time period, relative to many threads fighting at once.  Think orderly lines at the bank in a developed country compared to the Beijing Subway at Jianguomen or Fuxingmen!</p>
<p><strong>TEMPERATURE</strong></p>
<p><a title="Direct link to file" onclick="return false;" href="http://202.177.13.171/blog/wp-content/uploads/2007/09/temp.png"><img src="http://202.177.13.171/blog/wp-content/uploads/2007/09/temp.png" alt="TEMP" width="443" height="206" /> </a></p>
<p>A good 5 degrees lower in temp too.  That is not insignificant.  It all adds up to longer system life, better availability and lower costs.</p>
<p><strong>POWER</strong></p>
<p><a title="Direct link to file" onclick="return false;" href="http://202.177.13.171/blog/wp-content/uploads/2007/09/power.png"><img src="http://202.177.13.171/blog/wp-content/uploads/2007/09/power.png" alt="POWER" width="442" height="336" /> </a></p>
<p>Well out APC metered units aren&#8217;t that precise!  While you can&#8217;t see any change from last week to this one &#8211; probably due to the load balancing effect of our redundant power supplies and redundant PDU&#8217;s AND UPS&#8217; in between PDU&#8217;s and Servers (in addition to the IDC&#8217;s UPS&#8217;s and 4,000 Car Batts).  You CAN see the increase in Saturday and Sunday while the massive disk arrays churn flat chat to reinitialise&#8230;.that will need more power and also make more heat, needing more fan speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.candisgroup.com/blog/cloud/the-verdict-is-in/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL Upgrade Part 3</title>
		<link>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-upgrade-part-3</link>
		<comments>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-upgrade-part-3#comments</comments>
		<pubDate>Sat, 01 Sep 2007 12:40:16 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Enterprise Hardware]]></category>
		<category><![CDATA[FOSS/GNU/Linux]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array reconstruction]]></category>
		<category><![CDATA[big iron]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid level migration]]></category>
		<category><![CDATA[scsi]]></category>

		<guid isPermaLink="false">http://www.utilitycomputing.com.cn/?p=49</guid>
		<description><![CDATA[I knew the config files were different between 7.4 and 8.1 and that some items merely changed names and some were deprecated. I used this excellent resource before. Even the very rudimentary tweaks I did, and with a RAID array that is in a 90% rebuild rate, background initialisation, this 8.1 version is FAST! I [...]]]></description>
			<content:encoded><![CDATA[<p>I knew the config files were different between 7.4 and 8.1 and that some items merely changed names and some were deprecated.</p>
<p>I used <a href="http://www.powerpostgresql.com/Downloads/annotated_conf_80.html">this excellent resource</a> before.</p>
<p>Even the very rudimentary tweaks I did, and with a RAID array that is in a 90% rebuild rate, background initialisation, this 8.1 version is FAST!  I have no idea why people use MySQL, it really is such a piece of crud.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-upgrade-part-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL Upgrade Part 2</title>
		<link>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-upgrade-part-2</link>
		<comments>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-upgrade-part-2#comments</comments>
		<pubDate>Sat, 01 Sep 2007 12:03:14 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Enterprise Hardware]]></category>
		<category><![CDATA[FOSS/GNU/Linux]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[array reconstruction]]></category>
		<category><![CDATA[big iron]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid level migration]]></category>
		<category><![CDATA[scsi]]></category>

		<guid isPermaLink="false">http://www.utilitycomputing.com.cn/?p=48</guid>
		<description><![CDATA[Well, the PostgreSQL upgrade was a snap, sorta. I needed to do a full dump and restore as this was a major version change &#8211; no surprises there. What pissed me off though, is that when using the binary data type for dump files when using pg_dump (&#8220;-T c&#8221;) the resulting backup file is of [...]]]></description>
			<content:encoded><![CDATA[<p>Well, the PostgreSQL upgrade was a snap, sorta.  I needed to do a full dump and restore as this was a major version change &#8211; no surprises there.  What pissed me off though, is that when using the binary data type for dump files when using pg_dump (&#8220;-T c&#8221;) the resulting backup file is of no use for remote workers who aren&#8217;t at the actual console.</p>
<p>Let me expand on this;</p>
<p>This type of backup file is advertised as &#8220;more convenient&#8221; and offers more options for restore time selective data restores, data re-ording, index tricks and the like.  However no matter WHAT I did, it reported and sent a copy of the current pg_restore process and all the data being restored to standard output too!!  This means that basically, I was going to have the same full text of 20GB worth of database data shoved down my SSH session!</p>
<p>Yes &#8211; this makes the whole affair much slower!</p>
<p><span id="more-48"></span></p>
<p>Luckily, being the lateral thinking kind of dude that I am, I never put all my eggs in one basket.  That is just a recipe for data omelette.</p>
<p>I also had some plain text file dumps made from pg_dump.  So I went into the the PostgreSQL template1 sessions and then used the &#8220;\i&#8221; command to import my big .SQL file.  Perfect!  Only important updates sent to std output and not the whole damn enchilada.</p>
<p>Disk restore is still going on.  At a max through put of 20MByte a second with a 1000BaseT network, that is at best 1.2G a minute, 72GB an hour, so for 250GB approximately 3.5 hours.   However I was still doing a raid array background initialisation, so even after setting the rebuild rate to 10%, the system still needs a lot of time to move the files back &#8211; I didn&#8217;t bother to do the maths, because 3.5 hours or 10 hours it would all breach my maintenance window.</p>
<p>Because my advertised downtime window to clients was rapidly approaching, I had no choice but to continue to allow the copy to proceed, but redirect the main cluster to access the data store via NFS over the network and bring services back online.  I will then be able to do a RSYNC later in less than 1 hour to bring the haphazardly copied set on the main cluster in line with the now used and modified data store on my hot standby server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.candisgroup.com/blog/foss-gnu-linux/postgresql-upgrade-part-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

