<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: MySQL vs PostgreSQL Benchmarks</title>
	<atom:link href="http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html</link>
	<description>Just another Bastard Operator From Hell. Everything from *nix to programming</description>
	<lastBuildDate>Wed, 03 Mar 2010 09:48:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: On getting lighttpd + PHP working on OS X &#171; Pongo&#39;s thoughts</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-531</link>
		<dc:creator>On getting lighttpd + PHP working on OS X &#171; Pongo&#39;s thoughts</dc:creator>
		<pubDate>Tue, 02 Mar 2010 22:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-531</guid>
		<description>[...] this is site-specific. You probably want MySQL and don&#8217;t want PostgreSQL (even though it takes a lot to squeeze even equal performance out of MySQL).  That said, the only oddity is that on OS X, PHP [...]</description>
		<content:encoded><![CDATA[<p>[...] this is site-specific. You probably want MySQL and don&#8217;t want PostgreSQL (even though it takes a lot to squeeze even equal performance out of MySQL).  That said, the only oddity is that on OS X, PHP [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-524</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Sat, 30 Jan 2010 21:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-524</guid>
		<description>Very nice Testing :)
comparatively with Firebird Sql and / or Oracle would be very interesting.

Thx for testing !</description>
		<content:encoded><![CDATA[<p>Very nice Testing <img src='http://www.randombugs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
comparatively with Firebird Sql and / or Oracle would be very interesting.</p>
<p>Thx for testing !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magmatrix</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-521</link>
		<dc:creator>Magmatrix</dc:creator>
		<pubDate>Thu, 28 Jan 2010 13:44:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-521</guid>
		<description>A few suggestions:

- Try creating an index on the referenced table and re-run the bulk modify/bulk delete tests in PostgreSQL. Should be *much* faster.

- Also, you say you wanted to test &quot;crash proof databases&quot;. Run the tests again, and do the power plug test when the disk is busy. Does MySQL handle recovery as well as PostgreSQL does?</description>
		<content:encoded><![CDATA[<p>A few suggestions:</p>
<p>- Try creating an index on the referenced table and re-run the bulk modify/bulk delete tests in PostgreSQL. Should be *much* faster.</p>
<p>- Also, you say you wanted to test &#8220;crash proof databases&#8221;. Run the tests again, and do the power plug test when the disk is busy. Does MySQL handle recovery as well as PostgreSQL does?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Smith</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-520</link>
		<dc:creator>Greg Smith</dc:creator>
		<pubDate>Wed, 27 Jan 2010 21:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-520</guid>
		<description>Ignore the suggestion to turn fsync=off for PostgreSQL, and everything else pha said for that matter, those are all terrible ideas.  Disabling fsync means you&#039;ll end up with a corrupted database eventually that way after a crash--one where the server won&#039;t even start.  If you want to play loose with transaction commit dynamics in order to speed things up, you can try changing synchronous_commit=off (available in PG8.3 and later).  That will reduce the number of times fsync is called by committing things in larger chunks, with the downside you might lose something (but not have database corruption!) in that configuration after a crash.

You&#039;ve adjusted commit_delay = 1000, which is a bad idea too.  Leave that one at the default.  I doubt it will impact any of your tests, but it&#039;s a badly implemented feature.  It doesn&#039;t do what you&#039;d expect from the documentation, and it&#039;s due to be retired soon.  The effective impact of increasing that parameter right now is that you could be adding needless waits for a commit in some circumstances.

The rest of your PostgreSQL configuration is decent, and I&#039;d think a fair representative of what a basic (non-database expert) tuned database would look like given your hardware.  Good job.  There&#039;s a guide to this area at http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server that covers most of what people know to get started here you might pick up some hints from.  You might get a little boost by changing wal_buffers=16MB on some of the write-heavy tests here.

As for the slow deletes, that could just be PostgreSQL having more overhead when deleting a record due to the MVCC scheme it uses to handle transaction visibility.  That same overhead is what dramatically reduces locking and therefore improves scalability in more common read tasks, so in some respects it&#039;s probably want you want.  There are also some easy mistakes to make in how you setup foreign keys in PostgreSQL, and I&#039;m not sure if osdb has been audited to look for those recently.  I don&#039;t see one thing I&#039;d expect on a quick glance at its source code, so it&#039;s possible you&#039;re seeing an unfair comparison difference in the benchmark code itself.  Will have to take a look at exactly what it&#039;s doing here to confirm whether that&#039;s really the case or not.</description>
		<content:encoded><![CDATA[<p>Ignore the suggestion to turn fsync=off for PostgreSQL, and everything else pha said for that matter, those are all terrible ideas.  Disabling fsync means you&#8217;ll end up with a corrupted database eventually that way after a crash&#8211;one where the server won&#8217;t even start.  If you want to play loose with transaction commit dynamics in order to speed things up, you can try changing synchronous_commit=off (available in PG8.3 and later).  That will reduce the number of times fsync is called by committing things in larger chunks, with the downside you might lose something (but not have database corruption!) in that configuration after a crash.</p>
<p>You&#8217;ve adjusted commit_delay = 1000, which is a bad idea too.  Leave that one at the default.  I doubt it will impact any of your tests, but it&#8217;s a badly implemented feature.  It doesn&#8217;t do what you&#8217;d expect from the documentation, and it&#8217;s due to be retired soon.  The effective impact of increasing that parameter right now is that you could be adding needless waits for a commit in some circumstances.</p>
<p>The rest of your PostgreSQL configuration is decent, and I&#8217;d think a fair representative of what a basic (non-database expert) tuned database would look like given your hardware.  Good job.  There&#8217;s a guide to this area at <a href="http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server" rel="nofollow">http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server</a> that covers most of what people know to get started here you might pick up some hints from.  You might get a little boost by changing wal_buffers=16MB on some of the write-heavy tests here.</p>
<p>As for the slow deletes, that could just be PostgreSQL having more overhead when deleting a record due to the MVCC scheme it uses to handle transaction visibility.  That same overhead is what dramatically reduces locking and therefore improves scalability in more common read tasks, so in some respects it&#8217;s probably want you want.  There are also some easy mistakes to make in how you setup foreign keys in PostgreSQL, and I&#8217;m not sure if osdb has been audited to look for those recently.  I don&#8217;t see one thing I&#8217;d expect on a quick glance at its source code, so it&#8217;s possible you&#8217;re seeing an unfair comparison difference in the benchmark code itself.  Will have to take a look at exactly what it&#8217;s doing here to confirm whether that&#8217;s really the case or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Grittner</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-519</link>
		<dc:creator>Kevin Grittner</dc:creator>
		<pubDate>Wed, 27 Jan 2010 15:12:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-519</guid>
		<description>As has already been mentioned, the bulk delete results don&#039;t mean much because the index to make that fast was present in MySQL but not PostgreSQL.  There are legitimate reasons you might not want such an index in some circumstances, such as an &quot;insert-only&quot; table where the effort of maintaining such an index would be wasted, so PostgreSQL lets you choose whether to create it.
 
Also, it appears that the database only contained 1 GB of data, and the available RAM exceeded that.  In such situations you generally get better plans in PostgreSQL by configuring random_page_cost and seq_page_cost both to 0.01.  The given configuration would be more appropriate for a PostgreSQL database with hundreds or thousands of GB; and even there I usually have enough of the active portion of the database cached to drop random_page_cost to 2.</description>
		<content:encoded><![CDATA[<p>As has already been mentioned, the bulk delete results don&#8217;t mean much because the index to make that fast was present in MySQL but not PostgreSQL.  There are legitimate reasons you might not want such an index in some circumstances, such as an &#8220;insert-only&#8221; table where the effort of maintaining such an index would be wasted, so PostgreSQL lets you choose whether to create it.</p>
<p>Also, it appears that the database only contained 1 GB of data, and the available RAM exceeded that.  In such situations you generally get better plans in PostgreSQL by configuring random_page_cost and seq_page_cost both to 0.01.  The given configuration would be more appropriate for a PostgreSQL database with hundreds or thousands of GB; and even there I usually have enough of the active portion of the database cached to drop random_page_cost to 2.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivoras</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-518</link>
		<dc:creator>ivoras</dc:creator>
		<pubDate>Wed, 27 Jan 2010 14:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-518</guid>
		<description>You should be careful when benchmarking anything involving a classical hard drive - differences in rotational speeds of different cylinders and sensitivity to file fragmentation can wreck performance of anything. Some suggestions: either use a RAM drive for the database itself (best - will eliminate all effects from the drive), use a SSD (but always blank it with the factory-supplied utility before each benchmark to erase internal fragmentation / wear leveling data) or set up a special partition which has a size close to the database size, always format it with the same file system and file system options before doing different benchmark runs (e.g. when changing databases). 

Running database benchmarks from a &quot;generic&quot; partition where all the rest of the system data is, and especially running benchmarks on different databases installed on the same partition / file system one after the other can unbelievably increase file system fragmentation.</description>
		<content:encoded><![CDATA[<p>You should be careful when benchmarking anything involving a classical hard drive &#8211; differences in rotational speeds of different cylinders and sensitivity to file fragmentation can wreck performance of anything. Some suggestions: either use a RAM drive for the database itself (best &#8211; will eliminate all effects from the drive), use a SSD (but always blank it with the factory-supplied utility before each benchmark to erase internal fragmentation / wear leveling data) or set up a special partition which has a size close to the database size, always format it with the same file system and file system options before doing different benchmark runs (e.g. when changing databases). </p>
<p>Running database benchmarks from a &#8220;generic&#8221; partition where all the rest of the system data is, and especially running benchmarks on different databases installed on the same partition / file system one after the other can unbelievably increase file system fragmentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: another passer</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-516</link>
		<dc:creator>another passer</dc:creator>
		<pubDate>Sat, 23 Jan 2010 13:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-516</guid>
		<description>Hmmm, we have a production server that runs mysql... (mainly because we needed the speed) but seems that postgres could do a &quot;Much better&quot; work...
anyway nice post... keep up the good work...</description>
		<content:encoded><![CDATA[<p>Hmmm, we have a production server that runs mysql&#8230; (mainly because we needed the speed) but seems that postgres could do a &#8220;Much better&#8221; work&#8230;<br />
anyway nice post&#8230; keep up the good work&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: just walked by</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-512</link>
		<dc:creator>just walked by</dc:creator>
		<pubDate>Mon, 18 Jan 2010 05:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-512</guid>
		<description>Nice job but there is only one problem!
Your conclusion is making me hard to choose between MySQL or PostgreSQL.
I was going for PostgreSQL... but now I am not certain.</description>
		<content:encoded><![CDATA[<p>Nice job but there is only one problem!<br />
Your conclusion is making me hard to choose between MySQL or PostgreSQL.<br />
I was going for PostgreSQL&#8230; but now I am not certain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-504</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 24 Dec 2009 12:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-504</guid>
		<description>I&#039;m totally agree with you. Anyway MySQL is going with big stpes to real enterprise. Probably in the future it will be better.

Regards</description>
		<content:encoded><![CDATA[<p>I&#8217;m totally agree with you. Anyway MySQL is going with big stpes to real enterprise. Probably in the future it will be better.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ka Chun Leung</title>
		<link>http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html/comment-page-1#comment-503</link>
		<dc:creator>Ka Chun Leung</dc:creator>
		<pubDate>Mon, 21 Dec 2009 01:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.randombugs.com/?p=458#comment-503</guid>
		<description>The slow times for Postgresql Bulk Modify/Bulk Delete can be explained by foreign key references to the updates table.

MySQL automatically creates indexes on foreign keys which speeds up modifies/deletes on referenced fields at the expense of modify/insert performance on the referencing field.  Postgresql lets you decide</description>
		<content:encoded><![CDATA[<p>The slow times for Postgresql Bulk Modify/Bulk Delete can be explained by foreign key references to the updates table.</p>
<p>MySQL automatically creates indexes on foreign keys which speeds up modifies/deletes on referenced fields at the expense of modify/insert performance on the referencing field.  Postgresql lets you decide</p>
]]></content:encoded>
	</item>
</channel>
</rss>
