<?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: Do Androids Count Electric Sheep with DB2 or MySQL?	</title>
	<atom:link href="https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/</link>
	<description>Meditations on programming, startups, and technology</description>
	<lastBuildDate>Fri, 19 Jun 2009 20:03:28 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Both iPhone 3G S and DB2 available on the same date. Coincidence? &#124; FreeDB2.com		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6430</link>

		<dc:creator><![CDATA[Both iPhone 3G S and DB2 available on the same date. Coincidence? &#124; FreeDB2.com]]></dc:creator>
		<pubDate>Fri, 19 Jun 2009 20:03:28 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6430</guid>

					<description><![CDATA[[...] a steady following with the Apple Mac crowd. Antonio Cangiano recently did a little micro benchmark comparing MySQL and DB2 Express-C on his Apple MacBook Pro.  He also posted an open source project for TextMate bundle for DB2. If use TextMate on your Apple [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] a steady following with the Apple Mac crowd. Antonio Cangiano recently did a little micro benchmark comparing MySQL and DB2 Express-C on his Apple MacBook Pro.  He also posted an open source project for TextMate bundle for DB2. If use TextMate on your Apple [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Neil Lalonde		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6385</link>

		<dc:creator><![CDATA[Neil Lalonde]]></dc:creator>
		<pubDate>Fri, 12 Jun 2009 02:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6385</guid>

					<description><![CDATA[I find it hard to believe that any Rails app would use MyISAM tables, unless the developers don&#039;t plan to use transactions (scary!) AND they have no intention of using WHERE clauses.  In which case, maybe they can replace both MySQL and DB2 with a flat file or two.]]></description>
			<content:encoded><![CDATA[<p>I find it hard to believe that any Rails app would use MyISAM tables, unless the developers don&#8217;t plan to use transactions (scary!) AND they have no intention of using WHERE clauses.  In which case, maybe they can replace both MySQL and DB2 with a flat file or two.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mark Callaghan		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6354</link>

		<dc:creator><![CDATA[Mark Callaghan]]></dc:creator>
		<pubDate>Sun, 07 Jun 2009 02:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6354</guid>

					<description><![CDATA[My initial reaction to this result is that it was a &#039;bad benchmark&#039; because a significant difference was reported without explanation. And my first guess was that DB2 cached the table in the DBMS buffer cache and InnoDB did not because of different configurations.

My reaction was probably wrong and Antonio may have found an interesting result and something we need to investigate for MySQL.

Is DB2 that much more efficient than MySQL/InnoDB? Note that MyISAM is slower than InnoDB when there is anything in the WHERE clause that prevents it from using the codepath for fast count(*) queries.

When I run &#039;select count(*)&#039; on a table with a similar size and no indexes, the query takes ~0.4 seconds which is close to the result here.  Maybe DB2 is that much faster on count queries and we need to fix MySQL.

From oprofile, these are the top 4 functions:
25.0744 rec_get_offsets_func
19.3973 row_search_for_mysql
11.1162 buf_page_optimistic_get_func
10.1157 mtr_commit]]></description>
			<content:encoded><![CDATA[<p>My initial reaction to this result is that it was a &#8216;bad benchmark&#8217; because a significant difference was reported without explanation. And my first guess was that DB2 cached the table in the DBMS buffer cache and InnoDB did not because of different configurations.</p>
<p>My reaction was probably wrong and Antonio may have found an interesting result and something we need to investigate for MySQL.</p>
<p>Is DB2 that much more efficient than MySQL/InnoDB? Note that MyISAM is slower than InnoDB when there is anything in the WHERE clause that prevents it from using the codepath for fast count(*) queries.</p>
<p>When I run &#8216;select count(*)&#8217; on a table with a similar size and no indexes, the query takes ~0.4 seconds which is close to the result here.  Maybe DB2 is that much faster on count queries and we need to fix MySQL.</p>
<p>From oprofile, these are the top 4 functions:<br />
25.0744 rec_get_offsets_func<br />
19.3973 row_search_for_mysql<br />
11.1162 buf_page_optimistic_get_func<br />
10.1157 mtr_commit</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Antonio Cangiano		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6350</link>

		<dc:creator><![CDATA[Antonio Cangiano]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 17:29:55 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6350</guid>

					<description><![CDATA[Lonny wrote:
&lt;em&gt;Were you to add indexes, and count on indexed fields rather than (*), the performance for InnoDB in MySQL goes up dramatically.&lt;/em&gt;

As I mentioned before, adding an index improves the results a lot for COUNT(indexed field) but it does so in a way that is proportionate to the results shown here. This means that DB2 still is several times faster than MySQL when counting records, regardless of whether an index has been defined on a column for both databases or not.

It would be nice to do a follow up post which includes indexes and a few million records, but I suspect that people would still find other reasons to complain about the outcome. So I&#039;m not so sure it is worth the effort.

And just to clarify something once again, this post was not meant to demonstrate that DB2 is generally faster than MySQL, even if such is the case.]]></description>
			<content:encoded><![CDATA[<p>Lonny wrote:<br />
<em>Were you to add indexes, and count on indexed fields rather than (*), the performance for InnoDB in MySQL goes up dramatically.</em></p>
<p>As I mentioned before, adding an index improves the results a lot for COUNT(indexed field) but it does so in a way that is proportionate to the results shown here. This means that DB2 still is several times faster than MySQL when counting records, regardless of whether an index has been defined on a column for both databases or not.</p>
<p>It would be nice to do a follow up post which includes indexes and a few million records, but I suspect that people would still find other reasons to complain about the outcome. So I&#8217;m not so sure it is worth the effort.</p>
<p>And just to clarify something once again, this post was not meant to demonstrate that DB2 is generally faster than MySQL, even if such is the case.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lonny Eachus		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6346</link>

		<dc:creator><![CDATA[Lonny Eachus]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6346</guid>

					<description><![CDATA[To be clear, what I am saying is: Yes, this was just a &quot;micro-benchmark&quot;, and one should not read too much into that. However, under the circumstances, this benchmark does in fact NOT show what it purports to show: that DB2 is GENERALLY faster than MySQL.]]></description>
			<content:encoded><![CDATA[<p>To be clear, what I am saying is: Yes, this was just a &#8220;micro-benchmark&#8221;, and one should not read too much into that. However, under the circumstances, this benchmark does in fact NOT show what it purports to show: that DB2 is GENERALLY faster than MySQL.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Leon Katsnelson		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6345</link>

		<dc:creator><![CDATA[Leon Katsnelson]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 16:58:19 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6345</guid>

					<description><![CDATA[I am surprised and amazed how many people are saying that InnoDB is lousy at COUNT(*) so, Antonio, you should use MyISAM instead. Isn&#039;t the point of measuring things to compare them and to identify strengths and weaknesses? So, if Antonio did a benchmark that found that MyISAM did not do subselects very well then people would cry wolf and say you should have done this with InnoDB?
I think the benchmark is right on. If you are a Ruby on Rails programmer it is helpful to know how fast your object.count method will perform with MySQL vs. DB2. Majority of RoR programmers use MySQL and object.count is a common operation.]]></description>
			<content:encoded><![CDATA[<p>I am surprised and amazed how many people are saying that InnoDB is lousy at COUNT(*) so, Antonio, you should use MyISAM instead. Isn&#8217;t the point of measuring things to compare them and to identify strengths and weaknesses? So, if Antonio did a benchmark that found that MyISAM did not do subselects very well then people would cry wolf and say you should have done this with InnoDB?<br />
I think the benchmark is right on. If you are a Ruby on Rails programmer it is helpful to know how fast your object.count method will perform with MySQL vs. DB2. Majority of RoR programmers use MySQL and object.count is a common operation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lonny Eachus		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6344</link>

		<dc:creator><![CDATA[Lonny Eachus]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 16:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6344</guid>

					<description><![CDATA[Yes, but you still didn&#039;t address the point. The way your queries were performed acted precisely on the LEAST efficient operation you possibly could have chosen for MySQL. Regardless of whether it was done on purpose, it does skew the results.

Were you to add indexes, and count on indexed fields rather than (*), the performance for InnoDB in MySQL goes up dramatically. In one case, where I had a huge database (millions of records), the difference was between a full 10 minutes using count (*) and only a couple of seconds using count (indexed column).

Perhaps DB2 would outperform MySQL anyway, but, unintentional as it may be, this was still not a valid comparison. It is rather like racing a Ford sports car against a Chevy sports car, when the gas pedal on the Chevy has a block underneath that only lets the pedal go part way down.]]></description>
			<content:encoded><![CDATA[<p>Yes, but you still didn&#8217;t address the point. The way your queries were performed acted precisely on the LEAST efficient operation you possibly could have chosen for MySQL. Regardless of whether it was done on purpose, it does skew the results.</p>
<p>Were you to add indexes, and count on indexed fields rather than (*), the performance for InnoDB in MySQL goes up dramatically. In one case, where I had a huge database (millions of records), the difference was between a full 10 minutes using count (*) and only a couple of seconds using count (indexed column).</p>
<p>Perhaps DB2 would outperform MySQL anyway, but, unintentional as it may be, this was still not a valid comparison. It is rather like racing a Ford sports car against a Chevy sports car, when the gas pedal on the Chevy has a block underneath that only lets the pedal go part way down.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Antonio Cangiano		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6343</link>

		<dc:creator><![CDATA[Antonio Cangiano]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 14:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6343</guid>

					<description><![CDATA[Guys, I just want to clarify a few points. InnoDB was used because it&#039;s the default - and most widely adopted - engine in the Rails community. You may notice that an id column was added for ActiveRecord, and that I only used 4 columns from the initial dataset for the sake of simplicity. To keep things simple, I used the default limits which are provided by ActiveRecord (e.g., varchar(255)). This is a simple, micro-benchmark which doesn&#039;t need to prove much. It simply shows that with this data, under these conditions, DB2 is much faster than MySQL.

The reasons for choosing DB2 over MySQL are many, and they are not all related to performance. And even when considering performance alone, this post didn&#039;t set out to prove that DB2 is faster than MySQL in general. There are industry benchmarks that cost millions of dollars to run that take into account all the possible moving parts. You can&#039;t expect that from a simple post. I observed some data under particular circumstances and reported the outcome. While it is undisputed that DB2&#039;s counting abilities are still faster than MySQL with the InnoDB engine, this post only claims that with this data, for the query used, DB2 was faster than MySQL. And I think that&#039;s fair.

The &quot;100 times repetition&quot; freaked a few people out. I understand that. Please bear in mind though that I went for 100 iterations only after having seen somewhat comparable times obtained for the first execution of each query (i.e., n=1).]]></description>
			<content:encoded><![CDATA[<p>Guys, I just want to clarify a few points. InnoDB was used because it&#8217;s the default &#8211; and most widely adopted &#8211; engine in the Rails community. You may notice that an id column was added for ActiveRecord, and that I only used 4 columns from the initial dataset for the sake of simplicity. To keep things simple, I used the default limits which are provided by ActiveRecord (e.g., varchar(255)). This is a simple, micro-benchmark which doesn&#8217;t need to prove much. It simply shows that with this data, under these conditions, DB2 is much faster than MySQL.</p>
<p>The reasons for choosing DB2 over MySQL are many, and they are not all related to performance. And even when considering performance alone, this post didn&#8217;t set out to prove that DB2 is faster than MySQL in general. There are industry benchmarks that cost millions of dollars to run that take into account all the possible moving parts. You can&#8217;t expect that from a simple post. I observed some data under particular circumstances and reported the outcome. While it is undisputed that DB2&#8217;s counting abilities are still faster than MySQL with the InnoDB engine, this post only claims that with this data, for the query used, DB2 was faster than MySQL. And I think that&#8217;s fair.</p>
<p>The &#8220;100 times repetition&#8221; freaked a few people out. I understand that. Please bear in mind though that I went for 100 iterations only after having seen somewhat comparable times obtained for the first execution of each query (i.e., n=1).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Justin Swanhart		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6342</link>

		<dc:creator><![CDATA[Justin Swanhart]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 14:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6342</guid>

					<description><![CDATA[Wow.  I shouldn&#039;t read things in the middle of the night.  DB2 not PG.  Oops.  

*slaps forehead*]]></description>
			<content:encoded><![CDATA[<p>Wow.  I shouldn&#8217;t read things in the middle of the night.  DB2 not PG.  Oops.  </p>
<p>*slaps forehead*</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Justin Swanhart		</title>
		<link>https://programmingzen.com/do-androids-count-electric-sheep-with-db2-or-mysql/#comment-6339</link>

		<dc:creator><![CDATA[Justin Swanhart]]></dc:creator>
		<pubDate>Sat, 06 Jun 2009 12:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=800#comment-6339</guid>

					<description><![CDATA[I took a look at the feature, and it seems that PG will dynamically combine indexes using bitmaps.  I guess this is similar to the &#039;index merge&#039; functionality provided by MySQL.]]></description>
			<content:encoded><![CDATA[<p>I took a look at the feature, and it seems that PG will dynamically combine indexes using bitmaps.  I guess this is similar to the &#8216;index merge&#8217; functionality provided by MySQL.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
