<?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>JortK.nl &#187; myisam</title>
	<atom:link href="http://www.jortk.nl/tag/myisam/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jortk.nl</link>
	<description>Mind farts of a crappy coder!</description>
	<lastBuildDate>Tue, 29 May 2012 13:38:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>MySQL: Performance benchmark MyISAM versus InnoDB</title>
		<link>http://www.jortk.nl/2008/12/mysql-performance-benchmark-myisam-versus-innodb/</link>
		<comments>http://www.jortk.nl/2008/12/mysql-performance-benchmark-myisam-versus-innodb/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 11:13:52 +0000</pubDate>
		<dc:creator>JortK</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[myisam]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[storage engines]]></category>

		<guid isPermaLink="false">http://www.jortk.nl/?p=68</guid>
		<description><![CDATA[Because I&#8217;m running a project which has a relative large database (tables with 70.000.000 records in them), I wanted to know which was faster in performance, MyISAM or InnoDB. Currently I&#8217;m using MyISAM, and I&#8217;m running into some performance and stability issues. First, I&#8217;ve created a table with a few columns: CREATE TABLE `jointable` ( [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Because I&#8217;m running a project which has a relative large database (tables with 70.000.000 records in them), I wanted to know which was faster in performance, MyISAM or InnoDB.</p>
<p>Currently I&#8217;m using MyISAM, and I&#8217;m running into some performance and stability issues.</p>
<p>First, I&#8217;ve created a table with a few columns:<br />
<span id="more-68"></span></p>
<pre class="brush: sql;">
CREATE TABLE `jointable` (
`pk_id` int(11) NOT NULL auto_increment,
`indexed_int` int(11) default NULL,
`indexed_char` varchar(255) default NULL,
`randchar` varchar(255) default NULL,
PRIMARY KEY  (`pk_id`),
KEY `idx_indexed_int` (`indexed_int`),
KEY `idx_indexed_char` (`indexed_char`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
</pre>
<p>As you can see, the table contains a primary key, an indexed integer column and a indexed varchar column.</p>
<p>The storage engine is MyISAM,  but later in the benchmark test I will convert the table to InnoDB.</p>
<p>I filled the table with <strong>250.000 records</strong>.</p>
<p>Now I&#8217;m executing the following three queries, where I join the tables using the different fields:</p>
<pre class="brush: sql;">
-- Using the Primary key to join the tables
SELECT COUNT(t1.randchar), COUNT(t2.randchar)
FROM jointable t1
INNER JOIN jointable t2 ON t1.pk_id = t2.pk_id
</pre>
<pre class="brush: sql;">
-- Using the indexed integer column to join the tables
SELECT COUNT(t1.randchar), COUNT(t2.randchar)
FROM jointable t1
INNER JOIN jointable t2 ON t1.indexed_int = t2.indexed_int
</pre>
<pre class="brush: sql;">
-- Using the indexed char column to join the tables
SELECT COUNT(t1.randchar), COUNT(t2.randchar)
FROM jointable t1
INNER JOIN jointable t2 ON t1.indexed_char = t2.indexed_char
</pre>
<p>The results:</p>
<pre class="brush: sql;">
-- Results based on a 250.000 row recordset
__________________________________________________
|         | Primary Key | Int Index | Char index |
| MyISAM  | 3.09 sec    | 21.45 sec | 7.95 sec   |
| InnoDB  | 1.01 sec    | 18.48 sec | 19.09 sec  |
__________________________________________________
</pre>
<p>All the queries are executed with an empty MySQL cache (I restarted MySQL after every query).</p>
<p>Overall InnoDB is faster when joining data which have the integer datatype, only when you have ID&#8217;s based on the character datatype (for example GUID&#8217;s) InnoDB is slower than MyISAM.</p>
<p>It is recommended to use InnoDB, because on large databases (with tables with millions of records in it) the performance improvement will be even better!</p>
<p><strong>Useful Links:<br />
</strong><a title="Official InnoDB website" href="http://www.innodb.com" target="_blank">InnoDB project page</a><br />
<a title="Official MySQL documentation on MyISAM" href="http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html" target="_blank">MyISAM project page</a><br />
<a title="Wikipedia page on InnoDB MySQL storage engine" href="http://en.wikipedia.org/wiki/InnoDB" target="_blank">Wikipedia on InnoDB</a><br />
<a title="Wikipedia MyISAM storage engine" href="http://en.wikipedia.org/wiki/MyISAM" target="_blank">Wikipedia on MyISAM</a><br />
<a title="Overview of all the mysql storage engines" href="http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html" target="_blank">MySQL documentation about all the storage engines available</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jortk.nl/2008/12/mysql-performance-benchmark-myisam-versus-innodb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
