<?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>MySQL Performance Blog &#187; storage engine</title>
	<atom:link href="http://www.mysqlperformanceblog.com/category/storage-engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Sat, 21 Nov 2009 03:11:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Paul McCullagh answers your questions about PBXT</title>
		<link>http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 19:29:55 +0000</pubDate>
		<dc:creator>Morgan Tocker</dc:creator>
				<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pbxt]]></category>
		<category><![CDATA[storage engine]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[paul mccullagh]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1771</guid>
		<description><![CDATA[Following on from our earlier announcement, Paul McCullagh has responded with the answers to your questions &#8211; as well as a few I gathered from other Percona folks, and attendees of OpenSQL Camp.  Thank you Paul!
What’s the &#8220;ideal&#8221; use case for the PBXT engine, and how does it compare in performance?  When would I [...]]]></description>
			<content:encoded><![CDATA[<p><em>Following on from our earlier announcement, Paul McCullagh has responded with the answers to your questions &#8211; as well as a few I gathered from other Percona folks, and attendees of OpenSQL Camp.  Thank you Paul!</em></p>
<h3>What’s the &#8220;ideal&#8221; use case for the PBXT engine, and how does it compare in performance?  When would I use PBXT instead of a storage engine like MyISAM, InnoDB or XtraDB?</h3>
<p>Unfortunately it is not possible to point to a specific category of applications and say, &#8220;PBXT will be better here, so try it&#8221;.  PBXT is a general purpose transactional storage engine, designed to perform well on a broad range of tasks, much like InnoDB.  However, PBXT&#8217;s log-based architecture makes performance characteristics different to both MyISAM and InnoDB/XtraDB. Tests show that PBXT&#8217;s performance is similar to InnoDB but, depending on your database designed and the application, it can be faster.</p>
<p>PBXT is a community project and, of course, we depend on users trying it out. In the long run, this will determine to what extent we are able to continue to develop and improve the engine.  So, despite this rather vague answer, we are hoping that more people try it out, and work with us to improve the engine as necessary.  My thanks to all who are already doing this! <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>I think I remember reports that PBXT (at an early stage) out performed InnoDB with INSERTS and UPDATES (but not SELECTS). That would make PBXT very interesting for non-SELECT-intensive applications (finance, production management etc.) in my opinion.  Is this the case, and do you have any recent benchmarks available?</h3>
<p>This is no longer necessarily the case. For example a test (<a href="http://mysqlha.blogspot.com/2009/03/pbxt-is-fast-no-kidding.html" target="_blank">http://mysqlha.blogspot.com/2009/03/pbxt-is-fast-no-kidding.html</a>) by Mark Callaghan shows that PBXT can actually out perform InnoDB with SELECTs under circumstances.</p>
<p>The implementation of full-durability has changed the performance characteristics of PBXT from &#8220;MyISAM-like&#8221; to more InnoDB-like. Originally PBXT was conceived as an engine that would be somewhere between MyISAM and InnoDB in both performance and features. The early version of PBXT was not fully durable (equivalent to innodb_flush_log_at_trx_commit=2).</p>
<p>A major change was completed at the beginning of last year with the implementation of full-durability. In doing this it was important to keep the log-based architecture which was the reason for the high write performance of earlier versions.</p>
<p>Traditional transactional implementations suffer from the problem that a backlog of asynchronous writes accumulate until it swamps the engine. There has been a lot of work on both InnoDB and XtraDB to solve this problem. The key words here are fuzzy and adaptive checkpointing (the former, originally implementation by Heiki for InnoDB, and the latter, an excellent addition to XtraDB).</p>
<p>Both methods improve the management of the asynchronous writes. The idea behind the log-based solution, on the other hand, is to avoid the accumulating a backlog of asynchronous writes, but writing synchronously.</p>
<p>Although write performance is comparable with InnoDB, I am not entirely convinced that PBXT&#8217;s implementation of the log-based I/O is optimal at this stage. This is ongoing work for PBXT 1.5.</p>
<p><i>Morgan notes: As well as Adaptive Checkpointing, Oracle has also been working on Adaptive Flushing for the InnoDB Plugin.  The engine being &#8217;swamped&#8217; problem that Paul is referring to is best described visually &#8211; see <a href="http://www.mysqlperformanceblog.com/2008/11/13/adaptive-checkpointing/">this post</a> for more info.</i></p>
<h3>What were the hard decisions or trade-offs that you had to make when designing PBXT?</h3>
<p>If you read the white paper from 2006 (<a href="http://primebase.org/download/pbxt_white_paper.pdf" target="_blank">http://primebase.org/download/pbxt_white_paper.pdf</a>) you will notice that the original design was uncompromisingly MVCC-based.  Some of this has been changed to make PBXT more InnoDB-like, but other principles have remained.</p>
<p>Pure-MVCC does not do any locking. Read locks are not required because each transaction effectively gets its own snapshot of the database. And write locks are not acquired when updating. Instead, the application can hit a &#8220;optimistic lock error&#8221; if a record is updated by another user.</p>
<p>Now PBXT does acquire locks for 2 reasons: to support SELECT FOR UPDATE, and to avoid optimistic locking errors. This makes PBXT&#8217;s behavior identical to InnoDB in REPEATABLE READ mode.</p>
<p>On the other hand, there are currently no plans to implement InnoDB style &#8220;gap locking&#8221;. Gap locking effectively involves locking rows that do not exist. This, in turn, means that PBXT transactions are not SERIALIZABLE.  A result of this is that statement-based replication is not supported by the engine.</p>
<p>Another hard decision was not to implement clustered indexes which I mentioned in more details later.</p>
<h3>How does online backup work in PBXT, and is incremental backup possible?</h3>
<p>A recent version of PBXT (1.0.09) supports the MySQL Backup API which was originally implemented in MySQL 6.0. This feature is now scheduled for an upcoming version of MySQL 5.4.</p>
<p>The Backup API makes it possible to pull a consistent snapshot of an entire database even when tables use different engine types. The API does not yet support incremental backup, but this is planned.</p>
<p>Internally this feature is implemented by PBXT using an MVCC-based consistent snapshot.</p>
<h3>Does PBXT have a maintenance thread like InnoDB&#8217;s main thread?</h3>
<p>PBXT has several system threads, that are responsible for various maintenance tasks. The most important of these are the &#8220;Writer&#8221;, the &#8220;Sweeper&#8221; and the &#8220;Checkpointer&#8221;;</p>
<ul>
<li> The Writer transfers data from the transaction log to the database table files. This task runs constantly and is the main source of asynchronous I/O in the engine.</li>
<li> The Sweeper is a thread unique to the PBXT architecture. It&#8217;s job is to clean up after a transaction. Basically it recognizes which record versions are no longer needed and deletes them from the database.</li>
<li> The Checkpointer flushes the data written by the Writer to disk. It is also responsible for writing consistent snapshots of the index files to disk. The frequency of checkpoints, as with other engines like InnoDB, determines the recovery time.</li>
</ul>
<h3>Does PBXT support clustered indexes?</h3>
<p>No, currently it does not. This is one of the original design decisions (as raised by a previous question).  Two things contributed to this decision:</p>
<ul>
<li> Supporting clustered indexes would have made the implementation of PBXT more complicated than I would have liked. My goal was to make PBXT as simple as possible, so that it is easy to maintain the code and add features.</li>
<li> I believe clustered indexes are becoming less relevant with the rise of Solid State technology. As random read access times decrease clustering of data will become less and less important.</li>
</ul>
<h3>What is the page size in PBXT, and can it be tuned?</h3>
<p>PBXT uses 16K pages for the index data and (approximately) 32K pages for the table data. Both sizes can be set using compile time switches. However, if the index page size is changed, then the indices need to be rebuilt, which can be done by REPAIR TABLE.  The table data page size does not require a rebuild because a page of records in the table is just a group of records (not an actual fixed length page).</p>
<h3>Are there any differences in the PBXT implementation of MVCC that might surprise experienced InnoDB DBAs?  Also &#8211; In MVCC does it keep the versions in indexes, and can PBXT use MVCC for index scans?</h3>
<p>If you are using InnoDB in REPEATABLE READ mode, then there is essentially no difference in the isolation paradigm between the two engines.</p>
<p>REPEATABLE READ is often preferred over SERIALIZABLE mode because it allows a greater degree of concurrency while still providing the necessary transaction isolation. So I do not consider the lack of serializability as a serious deficit in the engine. And, fortunately MySQL 5.1. supports row-based replication which makes it possible to do replication while using REPEATABLE READ.</p>
<p>PBXT does use MVCC to do index scans. Basically this means that all types of SELECTs can be done without locking.</p>
<p><i>Morgan notes: Indexes not using MVCC is one of the main differences in the Falcon storage engine.</i></p>
<h3>PBXT supports row-level locking and foreign keys. Does this create any additional locking overhead that we should be aware of?</h3>
<p>Firstly, PBXT does not acquire read locks. A normal SELECT does not lock at all. In addition, an UPDATE or DELETE only acquires a temporary row-lock. This lock is released when the row is updated or deleted because the MVCC system can detect that a row has been changed (and is therefore write locked).</p>
<p>This means that PBXT does not normally need to maintain long lists of row-level locks. This is also the case when a foreign key leads to cascading operations which can affect thousands of rows.</p>
<p>The only case you need to be aware of is SELECT FOR UPDATE. This operation acquires and holds a row-level lock for each row returned by the SELECT. These locks are all stored in RAM. The format is quite compact (especially when row IDs are consecutive) but this can become an issue if millions of rows are selected in this manner.</p>
<p>I should also mention that the consequence of this is that SELECT &#8230; LOCK IN SHARE MODE is currently not supported.</p>
<h3>When I evaluate a storage engine my key acceptance criteria are things like backup, concurrency, ACID compliance and crash recovery. As a storage engine developer, what other criteria do you think I should be adding?</h3>
<p>Yes, I think you have mentioned the most important criteria. What I can add to this list are 3 things that make developing a storage engine extremely demanding: performance, stability and data integrity.</p>
<p>Of course, as a DBA or database user these aspects are so basic that they are taken for granted.</p>
<p>But engine developers need to keep performance, stability and data integrity in mind constantly. The problem is, they compete with each other: increasing performance often causes instabilities that then have to be fixed. How to optimize the program without compromising data integrity is a constant question.</p>
<p>Relative to maintaining performance, stability and data integrity, adding features to an engine is easy. So I would say that these are the criteria that concern a developer the most.</p>
<h3>MySQL supports a &#8220;pluggable storage engine API&#8221;, but it seems that not all the storage engine vendors are able to keep all their code at that layer (Infobright had to make major changes to MySQL itself).  What war stories can you report on in plugging into MySQL?</h3>
<p>Unfortunately the &#8220;war&#8221; continues. I have already received several e-mails that PBXT does not compile with the recently released MySQL 5.1.41!</p>
<p>Any dot release can lead to this problem, and I think PBXT is fairly moderate with its integration into MySQL.</p>
<p>My main advantage: I have been able to avoid modifying any part of MySQL to make the engine work. This means that PBXT runs with the standard MySQL/MariaDB distribution.</p>
<p>But this has required quite a bit of creative work, in other words, hacks.</p>
<p>One of the main problems has been running into global locks when calling back into MySQL to do things like open a table, create a session structure (THD) or create a .frm file.</p>
<p>One extreme example of this is PBXT recovery. When MySQL calls the engine &#8220;init&#8221; method on startup it is holding the global LOCK_plugin lock. In init, the engine needs to do recovery. In PBXT&#8217;s case this means opening tables (reading a .frm file), which requires creating a THD. The code to create a THD in turn tries to acquire LOCK_plugin!</p>
<p>Unfortunately a thread hangs if it tries to acquire the same mutex twice, so this just does not work!</p>
<p>We went through quite a few iterations (MySQL code was also changing during the development of 5.1) before we came up with the current solution: create a background thread to do recovery asynchronously. So the thread can wait for the LOCK_plugin to be unlocked before it continues.</p>
<p>The affect is that the init function returns quickly, but the first queries that access PBXT tables may hang waiting for recovery to complete.</p>
<h3>PBXT seems to have very few configuration parameters.  Was this an intentional design decision, and do you see it creating opportunities for you in organizations with less internal IT-expertise?</h3>
<p>No, this is not by design.</p>
<p>While I try to only add tuning parameters that are absolutely necessary, PBXT is not specifically designed to be self-tuning, because I believe that is a very hard problem to solve in general.</p>
<p>Tuning parameters are often added to an engine in response to performance problems in particular configurations. This is not necessarily a bad thing because it provides DBA&#8217;s with the tools they need.</p>
<p>My goal for PBXT in this regard is twofold:</p>
<ol>
<li>I hope that most installations can get away with setting a minimum of tuning parameters, in particular, just the cache values.</li>
<li>On the other hand, I aim to provide expert tuning parameters for installations that need to extract maximum performance from the hardware. This work is ongoing.</li>
</ol>
<p><i>Morgan notes: There are more in InnoDB/XtraDB now than there were three years ago.  This is probably something that emerges over time as we get to understand more about an engine.</i></p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Morgan Tocker |
      <a href="http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/#comments">No comment</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/&amp;title=Paul McCullagh answers your questions about PBXT" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/&amp;title=Paul McCullagh answers your questions about PBXT" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/&amp;title=Paul McCullagh answers your questions about PBXT" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/&amp;T=Paul McCullagh answers your questions about PBXT" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/&amp;title=Paul McCullagh answers your questions about PBXT" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/11/20/paul-mccullagh-answers-your-questions-about-pbxt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interviews for InfiniDB and TokuDB are next</title>
		<link>http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:53:12 +0000</pubDate>
		<dc:creator>Morgan Tocker</dc:creator>
				<category><![CDATA[community]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[storage engine]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1736</guid>
		<description><![CDATA[I forwarded on a list of questions about PBXT to Paul McCullagh today.  While Paul&#8217;s busy answering them, I&#8217;d like to announce that Robert Dempsey (InfiniDB storage engine) and Bradley C. Kuszmaul (TokuDB storage engine) have also accepted an interview.  If you have any questions about either storage engine, please post them here by [...]]]></description>
			<content:encoded><![CDATA[<p>I forwarded on a <a href="http://www.mysqlperformanceblog.com/2009/11/12/would-you-like-to-ask-a-question-about-pbxt/">list of questions</a> about PBXT to Paul McCullagh today.  While Paul&#8217;s busy answering them, I&#8217;d like to announce that Robert Dempsey (<a href="http://www.infinidb.org/">InfiniDB</a> storage engine) and Bradley C. Kuszmaul (<a href="http://tokutek.com/">TokuDB</a> storage engine) have also accepted an interview.  If you have any questions about either storage engine, please post them here by Friday 20th November.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Morgan Tocker |
      <a href="http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/#comments">No comment</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/&amp;title=Interviews for InfiniDB and TokuDB are next" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/&amp;title=Interviews for InfiniDB and TokuDB are next" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/&amp;title=Interviews for InfiniDB and TokuDB are next" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/&amp;T=Interviews for InfiniDB and TokuDB are next" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/&amp;title=Interviews for InfiniDB and TokuDB are next" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/11/16/interviews-for-infinidb-and-tokudb-are-next/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XtraDB storage engine release 1.0.3-6</title>
		<link>http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 20:44:51 +0000</pubDate>
		<dc:creator>Aleksandr Kuzminsky</dc:creator>
				<category><![CDATA[release]]></category>
		<category><![CDATA[storage engine]]></category>
		<category><![CDATA[xtradb]]></category>
		<category><![CDATA[MySQL Storage Engine]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=719</guid>
		<description><![CDATA[Dear community,
Today we are pleased to announce release 6 of XtraDB &#8211; the result of 2 months hard work.
The release includes following new features:

MySQL 5.1.36 as a base release
New patch  innodb_recovery_patches.patch
Experimental adaptive checkpoint method estimate
innodb_stats &#8211; the implementation of the fix forMySQL Bug#30423
expand-import Support of import InnoDB / XtraDB tables from another server
split-bufpool-mutex-3 New [...]]]></description>
			<content:encoded><![CDATA[<p>Dear community,</p>
<p>Today we are pleased to announce release 6 of XtraDB &#8211; the result of 2 months hard work.</p>
<p>The release includes following new features:</p>
<ul>
<li>MySQL 5.1.36 as a base release</li>
<li>New patch  <code>innodb_recovery_patches.patch</code></li>
<li>Experimental adaptive checkpoint method <strong>estimate</strong></li>
<li>innodb_stats &#8211; the implementation of the fix for<a href="http://bugs.mysql.com/bug.php?id=30423">MySQL Bug#30423</a></li>
<li><a class="link" title="Show revision 66" href="http://bazaar.launchpad.net/%7Epercona-dev/percona-xtradb/extensions-1.0/revision/66">expand-import</a> Support of import InnoDB / XtraDB tables from another server</li>
<li><a class="link" title="Show revision 65" href="http://bazaar.launchpad.net/%7Epercona-dev/percona-xtradb/extensions-1.0/revision/65">split-bufpool-mutex-3</a> New patch to split buffer pool mutex</li>
<li><a class="link" title="Show revision 64" href="http://bazaar.launchpad.net/%7Epercona-dev/percona-xtradb/extensions-1.0/revision/64">g-style-io-thread</a> Google&#8217;s fixes to InnoDB IO threads</li>
<li><a class="link" title="Show revision 63" href="http://bazaar.launchpad.net/%7Epercona-dev/percona-xtradb/extensions-1.0/revision/63">dict-size-limit</a> Limit of internal data dictionary</li>
</ul>
<p>Fixed bugs:</p>
<ul>
<li><a href="http://bugs.mysql.com/39793">MySQL Bugs: #39793: Foreign keys not constructed when column has a &#8216;#&#8217; in a comment or default value</a></li>
<li><a href="https://bugs.launchpad.net/percona-xtradb/+bug/395784">Bug #395784 in Percona-XtraDB: “main.innodb_xtradb_bug317074 internal check fails on 5.1.36”</a></li>
<li><a href="https://bugs.launchpad.net/percona-xtradb/+bug/395778">Bug #395778 in Percona-XtraDB: “main.innodb-analyze internal check failed on 5.1.36”</a></li>
<li><a href="https://bugs.launchpad.net/percona-xtradb/+bug/391189">Bug #391189 in Percona-XtraDB: “main.innodb_bug36172 mysq test fails with innodb_stat.patch applied”</a></li>
<li><a href="https://bugs.launchpad.net/percona-xtradb/+bug/388884">Bug #388884 in Percona-XtraDB: “patching fails on 5.1.35”</a></li>
</ul>
<p>The builds for RedHat4,5 and Debian are located on <a href="http://www.percona.com/mysql/xtradb/5.1.36-6/">http://www.percona.com/mysql/xtradb/5.1.36-6/</a><br />
The latest source code of XtraDB, including development branch you can find on <a href="https://launchpad.net/percona-xtradb">LaunchPAD</a>.</p>
<p>Please report any bugs found on <a href="https://bugs.launchpad.net/percona-xtradb/+bugs-index">Bugs in Percona XtraDB Storage Engine for MySQL</a>.<br />
For general questions use our <a href="http://groups.google.com/group/percona-discussion">Pecona-discussions</a> group, and for development question <a href="http://groups.google.com/group/percona-dev">Percona-dev</a> group.</p>
<p>For support, commercial and sponsorship inquiries contact <a href="http://www.percona.com/contacts.html">Percona</a></p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Aleksandr Kuzminsky |
      <a href="http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/#comments">6 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/&amp;title=XtraDB storage engine release 1.0.3-6" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/&amp;title=XtraDB storage engine release 1.0.3-6" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/&amp;title=XtraDB storage engine release 1.0.3-6" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/&amp;T=XtraDB storage engine release 1.0.3-6" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/&amp;title=XtraDB storage engine release 1.0.3-6" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/07/20/xtradb-storage-engine-release-1-0-3-6/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The feature I love in TokuDB</title>
		<link>http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:48:00 +0000</pubDate>
		<dc:creator>Vadim</dc:creator>
				<category><![CDATA[storage engine]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[MySQL Storage Engine]]></category>
		<category><![CDATA[TokuDB]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=701</guid>
		<description><![CDATA[Playing with TokuDB updates I noticed in SHOW PROCESSLIST unsual for MySQL State.
PLAIN TEXT
CODE:




mysql&#62; show processlist;


+----+------+-----------+--------+---------+------+---------------------------+-----------------------------+


&#124; Id &#124; User &#124; Host&#160; &#160; &#160; &#124; db&#160; &#160; &#160;&#124; Command &#124; Time &#124; State&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#124; Info&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#124;


+----+------+-----------+--------+---------+------+---------------------------+-----------------------------+


&#124;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Playing with TokuDB updates I noticed in SHOW PROCESSLIST unsual for MySQL State.</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&gt; show processlist;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+----+------+-----------+--------+---------+------+---------------------------+-----------------------------+</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| Id | User | Host&nbsp; &nbsp; &nbsp; | db&nbsp; &nbsp; &nbsp;| Command | Time | State&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Info&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+----+------+-----------+--------+---------+------+---------------------------+-----------------------------+</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; <span style="color:#800000;color:#800000;">3</span> | root | localhost | sbtest | Query&nbsp; &nbsp;|&nbsp; &nbsp;<span style="color:#800000;color:#800000;">30</span> | Updated about <span style="color:#800000;color:#800000;">764000</span> rows | update sbtest set email=zip |</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">mysql</span>&gt; show processlist;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+----+------+-----------+--------+---------+------+----------------------------+-----------------------------+</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| Id | User | Host&nbsp; &nbsp; &nbsp; | db&nbsp; &nbsp; &nbsp;| Command | Time | State&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Info&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+----+------+-----------+--------+---------+------+----------------------------+-----------------------------+</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; <span style="color:#800000;color:#800000;">3</span> | root | localhost | sbtest | Query&nbsp; &nbsp;|&nbsp; &nbsp;<span style="color:#800000;color:#800000;">79</span> | Updated about <span style="color:#800000;color:#800000;">1900000</span> rows | update sbtest set email=zip |</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>(Do not look in stupid UPDATE query, it's just for testing <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>So looking in SHOW PROCESSLIST you can see progress of query execution.</p>
<p>I would want to see it in standard MySQL and InnoDB more than all these triggers and stored routines! Probably will implement this in XtraDB.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Vadim |
      <a href="http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/#comments">4 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/&amp;title=The feature I love in TokuDB" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/&amp;title=The feature I love in TokuDB" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/&amp;title=The feature I love in TokuDB" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/&amp;T=The feature I love in TokuDB" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/&amp;title=The feature I love in TokuDB" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/06/11/the-feature-i-love-in-tokudb/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Detailed review of Tokutek storage engine</title>
		<link>http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 22:15:11 +0000</pubDate>
		<dc:creator>Vadim</dc:creator>
				<category><![CDATA[storage engine]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=664</guid>
		<description><![CDATA[(Note: Review was done as part of our consulting practice, but is totally independent and fully reflects our opinion)
I had a chance to take look TokuDB (the name of the Tokutek storage engine), and run some benchmarks. Tuning of TokuDB is much easier than InnoDB, there only few parameters to change, and actually out-of-box things [...]]]></description>
			<content:encoded><![CDATA[<p>(Note: Review was done as part of our consulting practice, but is totally independent and fully reflects our opinion)</p>
<p>I had a chance to take look TokuDB (the name of the Tokutek storage engine), and run some benchmarks. Tuning of TokuDB is much easier than InnoDB, there only few parameters to change, and actually out-of-box things running pretty well.</p>
<p>There are some rumors circulating that TokuDB is ”.. only an in memory or read-only engine, and that's why inserts are so fast”. This is not actually the case, as TokuDB is a disk-based, read-write transactional storage engine that is based on special “fractal tree indexes”. Fractal Trees are a drop-in-replacement for a B-tree (based on current research in data structures by professors at Stony Brook, Rutgers, and MIT). I can't say exactly how it is improved, because the engine itself is closed source. </p>
<p><a href='http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240871860-clip-9kb.png'><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240871860-clip-9kb.png" alt="" title="1240871860-clip-9kb" width="500" height="324" class="alignnone size-full wp-image-669" /></a></p>
<p>Along with its “fractal tree indexes”, TokuDB also uses compression, which significantly ( Graph 1) reduces dataset and decreases the amount of IO operations. The benefit of small size is also that TokuDB can keep in memory much more records then InnoDB / MyISAM. Actually in internal cache records are stored in uncompressed form, but OS Cache can keep compressed pages in memory. For the data set we tested, TokuDB used 6.2x less disk space than InnoDB, and 5.5x less disk space than MyISAM.</p>
<p>For tests I used Dell PowerEdge R900, with RAID 10 on 8 disks (2.5" SAS disks, 15K RPMS) and 32GB of physical RAM, but restricted on kernel level to 4GB to emulate case B-Tree does not fit into memory.<br />
As benchmark software I tried iiBench, which you can take there <a href="https://launchpad.net/mysql-patch/mytools">https://launchpad.net/mysql-patch/mytools </a></p>
<p>What makes fractal indexes so interesting is the amount of IO operations to update index tree is significantly less than for usual B-Tree index. It's as if Fractal Trees turn random IO into sequential IO. This is why you see the results that you do in iiBench test ( Graph 2), and the number of inserts/sec is almost linear even when table size bigger than available memory. For the last 10M rows inserted, InnoDB averaged 1,555 rows/sec while TokuDB averaged 16,437 rows/sec - about 10.6x faster. One consequence of having such fast indexes, is that you can maintain a richer set of indexes at a given incoming data rate, enabling much higher query performance. </p>
<p><a href='http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240872232-clip-32kb.png'><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240872232-clip-32kb.png" alt="" title="1240872232-clip-32kb" width="499" height="326" class="alignnone size-full wp-image-670" /></a></p>
<p>Beside iiBench we run benchmarks of SELECT queries again one of our click analyzing schema, in two modes - 1. data size is much more then memory and 2. data fits into memory. </p>
<p><a href='http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240871907-clip-7kb.png'><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240871907-clip-7kb.png" alt="" title="1240871907-clip-7kb" width="482" height="288" class="alignnone size-full wp-image-671" /></a><a href='http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240871938-clip-7kb.png'><img src="http://www.mysqlperformanceblog.com/wp-content/uploads/2009/04/1240871938-clip-7kb.png" alt="" title="1240871938-clip-7kb" width="482" height="290" class="alignnone size-full wp-image-672" /></a></p>
<p>As you see in IO-bound case TokuDB outperforms InnoDB 1.4-2.5x times, but CPU-bound is not so good. I think there we meet one of current restrictions of TokuDB - SERIALIZABLE isolation level for transactions.</p>
<p>Speaking about restrictions, the current problems I see are:<br />
  - Transactions only support the SERIALIZABLE isolation level. Beside it TokuDB does not scale well on multi-cores even in only SELECT queries. What this practically means it that you can't get benefit of multi-core boxes running concurrent threads. Tokutek plans to fix this in one of the next releases.<br />
  - We did not tested wide range of queries, but by design expect there may be not good results for some kind of queries, i.e. point select queries, as in this case TokuDB has to read and decompress big portion of data.<br />
  - Despite Inserts and Deletes are fast, updates are not expected to show the same performance gain, as to update we need to read data, and in this case - read previous comment.<br />
  - The version we tested did not yet support recovery logs. The code for it is ready, and will be available in a release soon.<br />
  - The ways to do a backup is mysqldump/mysqlhotcopy. It is not fully transparent backup, as it applied TABLE LOCK on copying table. When recovery logs are supported, I guess it will be possible to run LVM backup. Actually I would say backup is only partially the problem of storage engine. The biggest problem is that MySQL does not yet provide an interface for that. This is going to be fixed in MySQL 6.0, but I can't yet say how it will work with mix of storage engines.<br />
  - The Tokutek engine I tested comes in binary form and mysqld binary does not contain InnoDB. Tokutek tells me that InnoDB will be included in a future release.</p>
<p>With all the given advantages and drawbacks, I see a good practical usage of TokuDB for log analyzing and log reporting queries. By log analyzing I mean any kind of log producing application, it can be from simple apache logs put into mysql, application performance logs to more complex log like clicks, user movements and actions on site, visits tracking etc. While it may sound like an easy and trivial task, it is not at all. The more logs there are, the more space they take, and we have had setups where logs are 80% of total database size. Also there is the problem of being able to run custom reporting queries on logs. To do this, you often need many, often complex indexes which gives us the problem of random IO, waste of RAM memory and slow inserts. This is where I think Tokutek appears to be positioned to do quite good at. There are operation issues which make things more complex and, probably, I would not put yet TokuDB on customer production boxes, but it may good fit to non-critical slave where you can run analyzing queries. </p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Vadim |
      <a href="http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/#comments">20 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/&amp;title=Detailed review of Tokutek storage engine" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/&amp;title=Detailed review of Tokutek storage engine" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/&amp;title=Detailed review of Tokutek storage engine" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/&amp;T=Detailed review of Tokutek storage engine" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/&amp;title=Detailed review of Tokutek storage engine" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/04/28/detailed-review-of-tokutek-storage-engine/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>How to decrease InnoDB shutdown times</title>
		<link>http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 15:21:49 +0000</pubDate>
		<dc:creator>Baron Schwartz</dc:creator>
				<category><![CDATA[Innodb]]></category>
		<category><![CDATA[storage engine]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=660</guid>
		<description><![CDATA[Sometimes a MySQL server running InnoDB takes a long time to shut down.  The usual culprit is flushing dirty pages from the buffer pool. These are pages that have been modified in memory, but not on disk.
If you kill the server before it finishes this process, it will just go through the recovery phase [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes a MySQL server running InnoDB takes a long time to shut down.  The usual culprit is flushing dirty pages from the buffer pool. These are pages that have been modified in memory, but not on disk.</p>
<p>If you kill the server before it finishes this process, it will just go through the recovery phase on startup, which can be <a href="http://www.mysqlperformanceblog.com/?s=innodb+recovery+time">even slower</a> in stock InnoDB than the shutdown process, for a variety of reasons.</p>
<p>One way to decrease the shutdown time is to pre-flush the dirty pages, like this:</p>
<div class="igBar"><span id="lcode-5"><a href="#" onclick="javascript:showPlainTxt('code-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-5">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&gt; set global innodb_max_dirty_pages_pct = <span style="color:#800000;color:#800000;">0</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now run the following command:</p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ mysqladmin ext -i10 | grep dirty</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| Innodb_buffer_pool_pages_dirty&nbsp; &nbsp; | <span style="color:#800000;color:#800000;">1823484</span>&nbsp; &nbsp; &nbsp; &nbsp; |</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| Innodb_buffer_pool_pages_dirty&nbsp; &nbsp; | <span style="color:#800000;color:#800000;">1821293</span>&nbsp; &nbsp; &nbsp; &nbsp; |</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| Innodb_buffer_pool_pages_dirty&nbsp; &nbsp; | <span style="color:#800000;color:#800000;">1818938</span>&nbsp; &nbsp; &nbsp; &nbsp; | </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And wait until it approaches zero.  (If the server is being actively used, it won't get to zero.)</p>
<p>Once it's pretty low, you can perform the shutdown and there'll be a lot less unfinished work to do, so the server should shut down more quickly.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Baron Schwartz |
      <a href="http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/#comments">15 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/&amp;title=How to decrease InnoDB shutdown times" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/&amp;title=How to decrease InnoDB shutdown times" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/&amp;title=How to decrease InnoDB shutdown times" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/&amp;T=How to decrease InnoDB shutdown times" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/&amp;title=How to decrease InnoDB shutdown times" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>XtraDB storage engine release 1.0.3-4 codename Sakura</title>
		<link>http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 04:22:57 +0000</pubDate>
		<dc:creator>Evgeniy Stepchenko</dc:creator>
				<category><![CDATA[Innodb]]></category>
		<category><![CDATA[announce]]></category>
		<category><![CDATA[percona]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[storage engine]]></category>
		<category><![CDATA[xtradb]]></category>
		<category><![CDATA[XtraDB InnoDB scalability release]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=654</guid>
		<description><![CDATA[Today we glad to announce release 1.0.3-4 of our XtraDB storage engine.
Here is a list of enhancements in this release:

 Move to MySQL 5.1.33
Move to InnoDB plugin 1.0.3

more reliable replication, innodb_overwrite_relay_log_info patch now included in the release


fix assertions for UNIV_DEBUG


new fix for rw_lock patch


Percona XtraDB 1.0.3-4 (Sakura) available in source and several binary packages.
XtraDB is [...]]]></description>
			<content:encoded><![CDATA[<p>Today we glad to announce release 1.0.3-4 of our <a href="http://www.percona.com/docs/wiki/percona-xtradb:start">XtraDB storage engine</a>.</p>
<p>Here is a list of enhancements in this release:</p>
<ul>
<li> Move to <a href="http://dev.mysql.com/doc/refman/5.1/en/news-5-1-33.html" target="_blank">MySQL 5.1.33</a></li>
<li>Move to <a href="http://www.innodb.com/wp/2009/03/11/innodb-plugin-version-103-for-mysql-5130-32-33-released/" target="_blank">InnoDB plugin 1.0.3</a></li>
<li class="level1">
<div class="li">more <a href="http://www.mysqlperformanceblog.com/2009/03/04/making-replication-a-bit-more-reliable/">reliable replication</a>, <a class="wikilink1" title="percona-xtradb:patch:innodb_overwrite_relay_log_info" href="http://www.percona.com/docs/wiki/percona-xtradb:patch:innodb_overwrite_relay_log_info">innodb_overwrite_relay_log_info</a> patch now included in the release</div>
</li>
<li class="level1">
<div class="li">fix <a class="urlextern" title="https://bugs.launchpad.net/percona-xtradb/+bug/354302" rel="nofollow" href="https://bugs.launchpad.net/percona-xtradb/+bug/354302">assertions for UNIV_DEBUG</a></div>
</li>
<li class="level1">
<div class="li">new <a class="urlextern" title="https://bugs.launchpad.net/percona-xtradb/+bug/333750" rel="nofollow" href="https://bugs.launchpad.net/percona-xtradb/+bug/333750">fix for rw_lock patch</a></div>
</li>
</ul>
<p>Percona XtraDB 1.0.3-4 (Sakura) <a href="http://www.percona.com/docs/wiki/percona-xtradb:info:xtradb_downloads">available</a> in source and several binary packages.</p>
<p>XtraDB is compatible with existing InnoDB tables (unless you used innodb_extra_undoslots) and we are going to keep compatibility in further releases. We are open for features requests for new engine and ready to accept community patches. You can monitor Percona’s current tasks and further plans on the <a href="https://launchpad.net/percona-xtradb">Percona XtraDB Launchpad project</a>. You can also <a href="https://blueprints.launchpad.net/percona-xtradb">request features</a> and <a href="https://bugs.launchpad.net/percona-xtradb">report bugs</a> there. Also we have setup two maillists for <a href="http://groups.google.com/group/percona-discussion">General discussions</a> and for <a href="http://groups.google.com/group/percona-dev">Development related questions</a>.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Evgeniy Stepchenko |
      <a href="http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/#comments">9 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/&amp;title=XtraDB storage engine release 1.0.3-4 codename Sakura" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/&amp;title=XtraDB storage engine release 1.0.3-4 codename Sakura" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/&amp;title=XtraDB storage engine release 1.0.3-4 codename Sakura" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/&amp;T=XtraDB storage engine release 1.0.3-4 codename Sakura" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/&amp;title=XtraDB storage engine release 1.0.3-4 codename Sakura" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/04/08/xtradb-storage-engine-release-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>MySQL and IBM</title>
		<link>http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/</link>
		<comments>http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 06:40:30 +0000</pubDate>
		<dc:creator>Vadim</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[storage engine]]></category>
		<category><![CDATA[MySQL Storage Engines]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=652</guid>
		<description><![CDATA[No, this is not about Sun and IBM    This is about MySQL. If you download latest 5.1.33 source code you may find there storage/ibmdb2i directory, which obviously is IBM DB2 related. Interesting that there is no mentioning of new engine in Announcement http://dev.mysql.com/doc/refman/5.1/en/news-5-1-33.html.
Quick look into source code says
PLAIN TEXT
CODE:




MYSQL_STORAGE_ENGINE&#40;&#91;ibmdb2i&#93;, &#91;&#93;, &#91;IBM DB2 [...]]]></description>
			<content:encoded><![CDATA[<p>No, this is not about Sun and IBM <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   This is about MySQL. If you download latest 5.1.33 source code you may find there storage/ibmdb2i directory, which obviously is IBM DB2 related. Interesting that there is no mentioning of new engine in Announcement <a href="http://dev.mysql.com/doc/refman/5.1/en/news-5-1-33.html">http://dev.mysql.com/doc/refman/5.1/en/news-5-1-33.html</a>.<br />
Quick look into source code says</p>
<div class="igBar"><span id="lcode-9"><a href="#" onclick="javascript:showPlainTxt('code-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-9">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MYSQL_STORAGE_ENGINE<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>ibmdb2i<span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span>IBM DB2 for i Storage Engine<span style="color:#006600; font-weight:bold;">&#93;</span>,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span>IBM DB2 for i Storage Engine<span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span>max,max-no-ndb<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MYSQL_PLUGIN_DYNAMIC<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>ibmdb2i<span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span>ha_ibmdb2i.<span style="">la</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Also interesting that license of added files is not GPL, but</p>
<div class="igBar"><span id="lcode-10"><a href="#" onclick="javascript:showPlainTxt('code-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-10">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Licensed Materials - Property of IBM</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">DB2 Storage Engine Enablement</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Copyright IBM Corporation 2007,2008</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">All rights reserved</span></div>
</li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Redistribution and use in source and binary forms, with or without modification,</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">are permitted provided that the following conditions are met:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> (a) Redistributions of source code must retain this list of conditions, the</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;copyright notice in section {d} below, and the disclaimer following this</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;list of conditions.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> (b) Redistributions in binary form must reproduce this list of conditions, the</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;copyright notice in section (d) below, and the disclaimer following this</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;list of conditions, in the documentation and/or other materials provided</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;with the distribution.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> (c) The name of IBM may not be used to endorse or promote products derived from</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;this software without specific prior written permission.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> (d) The text of the required copyright notice is:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;Licensed Materials - Property of IBM</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;DB2 Storage Engine Enablement</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;Copyright IBM Corporation 2007,2008</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp;All rights reserved</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">THIS SOFTWARE IS PROVIDED BY IBM CORPORATION &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">OF SUCH DAMAGE.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I think this is outcome of 2-year old press release<br />
<a href="http://www-03.ibm.com/press/us/en/pressrelease/21430.wss">"MySQL AB and IBM Announce Open Source Database Support for the IBM System i Platform"</a>, it just took a bit a while to put it into source tree. I wonder what happened with policy not accept significant changes into production release.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Vadim |
      <a href="http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/#comments">17 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/&amp;title=MySQL and IBM" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/&amp;title=MySQL and IBM" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/&amp;title=MySQL and IBM" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/&amp;T=MySQL and IBM" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/&amp;title=MySQL and IBM" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2009/04/06/mysql-and-ibm/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>The MySQL optimizer, the OS cache, and sequential versus random I/O</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/</link>
		<comments>http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 02:18:38 +0000</pubDate>
		<dc:creator>Baron Schwartz</dc:creator>
				<category><![CDATA[optimizer]]></category>
		<category><![CDATA[storage engine]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/</guid>
		<description><![CDATA[In my post on estimating query completion time, I wrote about how I measured the performance on a join between a few tables in a typical star schema data warehousing scenario.
In short, a query that could take several days to run with one join order takes an hour with another, and the optimizer chose the [...]]]></description>
			<content:encoded><![CDATA[<p>In my post on <a href="http://www.mysqlperformanceblog.com/2008/04/22/how-to-estimate-query-completion-time-in-mysql/">estimating query completion time</a>, I wrote about how I measured the performance on a join between a few tables in a typical star schema data warehousing scenario.</p>
<p>In short, a query that could take several days to run with one join order takes an hour with another, and the optimizer chose the poorer of the two join orders.  Why is one join order so much slower than the other, and why did the optimizer not choose the faster one?  That's what this post is about.</p>
<p>Let's  start with the MySQL query optimizer.  The optimizer tries to choose the best join order based on its cost metric; it tries to estimate the cost for a query, then choose the query plan that has the lowest cost.  <strong>The unit of cost for the MySQL query optimizer is a single random 4k data page read</strong>.  In general, it's a pretty good metric, but it has one major weakness: the server doesn't know whether a read will be satisfied from the operating system cache, or whether it'll have to go to disk. (This distinction is abstracted away by the storage engine; the optimizer doesn't know how a given storage engine stores its data).</p>
<p>I'll try to omit the details and keep this clean.  Let's take a look at the tables.</p>
<div class="igBar"><span id="lsql-15"><a href="#" onclick="javascript:showPlainTxt('sql-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-15">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&amp;gt; <span style="color: #993333; font-weight: bold;">SHOW</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">STATUS</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'fact'</span>\G</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*************************** <span style="color: #cc66cc;color:#800000;">1</span>. row ***************************</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Name: fact</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Engine: MyISAM</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Rows: <span style="color: #cc66cc;color:#800000;">147045493</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Avg_row_length: <span style="color: #cc66cc;color:#800000;">117</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Data_length: <span style="color: #cc66cc;color:#800000;">17217646764</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Index_length: <span style="color: #cc66cc;color:#800000;">11993816064</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&amp;gt; <span style="color: #993333; font-weight: bold;">SHOW</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">STATUS</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'dim1'</span>\G</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*************************** <span style="color: #cc66cc;color:#800000;">1</span>. row ***************************</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Name: dim1</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Engine: MyISAM</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Rows: <span style="color: #cc66cc;color:#800000;">453193</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Avg_row_length: <span style="color: #cc66cc;color:#800000;">122</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Data_length: <span style="color: #cc66cc;color:#800000;">55605116</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Index_length: <span style="color: #cc66cc;color:#800000;">93812736</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mysql&amp;gt; <span style="color: #993333; font-weight: bold;">SHOW</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">STATUS</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'dim2'</span>\G</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*************************** <span style="color: #cc66cc;color:#800000;">1</span>. row ***************************</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Name: dim2</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Engine: MyISAM</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Rows: <span style="color: #cc66cc;color:#800000;">811</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Avg_row_length: <span style="color: #cc66cc;color:#800000;">105</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Data_length: <span style="color: #cc66cc;color:#800000;">85368</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Index_length: <span style="color: #cc66cc;color:#800000;">154624</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>It's a big fact table and two fairly small dimension tables, which is normal.  Here is the query:</p>
<div class="igBar"><span id="lsql-16"><a href="#" onclick="javascript:showPlainTxt('sql-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-16">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> fact.col1, min<span style="color:#006600; font-weight:bold;">&#40;</span>fact.col2<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> min_col2</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> fact, dim1, dim2</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> fact.col4 = dim1.col4</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">AND</span> dim1.col3 &lt;&gt; <span style="color: #ff0000;">'hello world'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">AND</span> dim2.col5 = <span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">AND</span> fact.dim2_id = dim2.dim2_id</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">AND</span> fact.col2&gt; some_const</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> fact.col1 </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>There are indexes on all the columns in all the ways you'd expect: all the dimension columns are indexed on every table, and there's a separate index on every column in the WHERE clause.  Here's the query plan initially.</p>
<div class="igBar"><span id="lsql-17"><a href="#" onclick="javascript:showPlainTxt('sql-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-17">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*************************** <span style="color: #cc66cc;color:#800000;">1</span>. row ***************************</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">TABLE</span>: dim1</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">type: range</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">key_len: <span style="color: #cc66cc;color:#800000;">195</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rows: <span style="color: #cc66cc;color:#800000;">18790</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Extra: <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">WHERE</span>; <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">TEMPORARY</span>; <span style="color: #993333; font-weight: bold;">USING</span> filesort</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*************************** <span style="color: #cc66cc;color:#800000;">2</span>. row ***************************</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">TABLE</span>: fact</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">type: ref</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">key_len: <span style="color: #cc66cc;color:#800000;">4</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rows: <span style="color: #cc66cc;color:#800000;">606</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Extra: <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">WHERE</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*************************** <span style="color: #cc66cc;color:#800000;">3</span>. row ***************************</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">TABLE</span>: dim2</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">type: eq_ref</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">key_len: <span style="color: #cc66cc;color:#800000;">2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rows: <span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Extra: <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">WHERE</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This query will run for days and never complete.  No one ever let it finish to see how long it would run.</p>
<p>How do I know it will run for days? Here's my train of thought:</p>
<ul>
<li>It's performing index lookups into the fact table, which is big.</li>
<li>An index lookup is a random I/O.</li>
<li>A modern disk can do about 100 random I/O's per second, as a rule of thumb.</li>
<li>If you do the math with the rows column in EXPLAIN, you realize that this equates to about 18790 * 606 = 11386740 I/O operations, assuming that the indexes are fully in memory.</li>
<li>When you divide this by 100 I/O operations per second, and then divide that by 86400 seconds in a day, you get about 2.6 days.</li>
</ul>
<p>Ouch!  That's slow.</p>
<p>Now let's look at the alternative: table-scan the fact table, and do index lookups in the two dimension tables.  MySQL doesn't want to choose this join order, so we'll force it with STRAIGHT_JOIN:</p>
<div class="igBar"><span id="lsql-18"><a href="#" onclick="javascript:showPlainTxt('sql-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span>
<div id="sql-18">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">EXPLAIN</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">STRAIGHT_JOIN</span>&nbsp; ....</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">-------+-----------+-----------+---------------------------------+</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| <span style="color: #993333; font-weight: bold;">TABLE</span> | type&nbsp; &nbsp; &nbsp; | rows&nbsp; &nbsp; &nbsp; | Extra&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">-------+-----------+-----------+---------------------------------+</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| fact&nbsp; | <span style="color: #993333; font-weight: bold;">ALL</span>&nbsp; &nbsp; &nbsp; &nbsp;| <span style="color: #cc66cc;color:#800000;">147367284</span> | <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">TEMPORARY</span>; <span style="color: #993333; font-weight: bold;">USING</span> filesort |</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| dim1&nbsp; | eq_ref&nbsp; &nbsp; | <span style="color: #cc66cc;color:#800000;">1</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">WHERE</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">| dim2&nbsp; | eq_ref&nbsp; &nbsp; | <span style="color: #cc66cc;color:#800000;">1</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #993333; font-weight: bold;">WHERE</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+<span style="color: #808080; font-style: italic;">-------+-----------+-----------+---------------------------------+ </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As we saw in the previous post, which I linked at the top of this post, we can scan the fact table in less than an hour.  And it turns out that joining to the dimension tables doesn't slow the query perceptibly, because these tables are small and they stay in memory, in the OS cache.  (They don't get evicted from memory by the cache's LRU policy, because they are frequently used -- once per row in the fact table.  The LRU policy evicts old blocks from the fact table instead, which is perfect -- these blocks are used only once and not needed again, so they can be replaced).</p>
<p>The difference between the two queries -- 55 minutes and 2.6 days -- is basically the difference between scanning data sequentially on disk and random disk I/O.</p>
<p>So now you know why one join order is faster than the other.  But why didn't the optimizer know this, too?  The optimizer does know that random access is slower than sequential access, <strong>but it doesn't know that the dimension tables will stay in memory</strong>, and this is an important distinction.</p>
<p>Let's put ourselves into the mindset of the optimizer.  We'll assume that every join to the dimension tables will go to disk instead of being read from cache.  Now the STRAIGHT_JOIN becomes a table scan of about 313 sequential reads (150 million rows / 117 bytes per row / 4096 bytes per read), plus about 150 million random I/Os for the first dimension table, plus 150 million random I/Os for the second dimension table.  That's 300 million random I/O operations.</p>
<p>In contrast, the optimizer chose a plan that it thought would cause only 11.3 million random I/O operations.</p>
<p>The optimizer was being smart, given its lack of knowledge about the OS cache.  This is why an expert  is sometimes needed to provide the missing information.  If the MySQL optimizer were right and each of these had to go to disk, our STRAIGHT_JOIN plan would take more than a month to complete!  Good thing we know the difference between cache and disk!</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by Baron Schwartz |
      <a href="http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/#comments">14 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/&amp;title=The MySQL optimizer, the OS cache, and sequential versus random I/O" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/&amp;title=The MySQL optimizer, the OS cache, and sequential versus random I/O" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/&amp;title=The MySQL optimizer, the OS cache, and sequential versus random I/O" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/&amp;T=The MySQL optimizer, the OS cache, and sequential versus random I/O" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/&amp;title=The MySQL optimizer, the OS cache, and sequential versus random I/O" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2008/04/28/the-mysql-optimizer-the-os-cache-and-sequential-versus-random-io/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>MVCC:  Transaction IDs, Log Sequence numbers and Snapshots</title>
		<link>http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/</link>
		<comments>http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 10:35:01 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[storage engine]]></category>

		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/</guid>
		<description><![CDATA[MySQL Storage Engines implementing Multi Version Concurrency Control have several internal identifiers related to MVCC. I see a lot of people being confused what they are and why they are needed so I decided to take a time to explain it a bit.   This is general explanation, it does not corresponds to Innodb [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL Storage Engines implementing Multi Version Concurrency Control have several internal identifiers related to MVCC. I see a lot of people being confused what they are and why they are needed so I decided to take a time to explain it a bit.   This is general explanation, it does not corresponds to Innodb in particular and some implementation can be different but I hope this will let you to understand MVCC a bit better.  </p>
<p><strong>Transaction ID</strong>  As the name says this is transaction identifier.  It can be used by the engine for many things - for lock handling to see which transaction holds the lock and possibly kill it in case of deadlock,  for proper isolation mode handling - transaction should see its own uncommitted changes but other transactions typically do not see them as well as MVCC implementation.  It also can be used for recovery so you can see to which transaction given change corresponds so you can roll back or redo changes for transaction depending if it was committed or not.</p>
<p><strong>Log Sequence Number (LSN)</strong>   Log Sequence Numbers correspond to given position in the log files and typically incremented for each log record.   Innodb uses number of bytes ever written to the log files however it could be something different.   LSNs are often extensively used in recovery  check pointing and buffer management operations.  When checkpoint (both fuzzy and not) happens you get something like "all changes up to LSN=X are now flushed to the data space" this means you can discard or archive logs for LSN earlier than that.    When doing log recovery checking LSN in the log record can tell if you this change needs to be applied or it already was applied (when doing recovery you do not know which dirty pages were flushed from the buffer pool).   </p>
<p>The LSN do not relate much to transactions - changes from different transactions are intermixed in the log files and many LSNs can correspond to changes from the same transaction.</p>
<p><strong>Snapshot Versions</strong>   This is the term which is often used to to identify what will be visible for given transaction/query, however  MVCC is usually implemented without having something like snapshot number. </p>
<p>Indeed if you look at it in details visibility for transaction is more complicated when some given "snapshot" - transaction tends to see its own changes, even if they are not committed.</p>
<p>What happens instead is - when transaction is started, the list of concurrently running transactions (not committed) is memorized.</p>
<p>For each row more than one version can be stored, each tagged with transaction IDs which added/modified and deleted the given version.   This data can be compressed/optimized to keep less information if possible, ie you do not really need to store transaction ID for the row which is so old it is visible to old running transaction anyway. </p>
<p>So what you can get for given row is something like:</p>
<p>Value  5      created by transaction 100<br />
Value  4      created by transaction 50<br />
Value  3      created by transaction 10, deleted by transaction 20.</p>
<p>This tracks most recent object history which tells you it was created as value 3 by some transaction when was deleted and there were no such row (ie with given PK) for some time and when couple of new versions were created.</p>
<p>When looking at the row in MVCC environment system has to determinate which of the current row versions is visible.  This can be done as simple as traversing the list of version down or something more complicated. </p>
<p>In the described case lets  consider transaction 101 which is running in REPEATABLE-READ isolation mode and which was started before transaction 100  have committed.    </p>
<p>In such case transaction 101 should not see changes done by transaction 100 and will read value 4 created by transaction 50.</p>
<p>We also need to track when given transaction has committed, in the list of transactions which were active at the time current transaction was started.    This is needed for example to handle READ-COMMITTED isolation mode.    </p>
<p>Lets look at transaction 102 which was started in READ-COMMITTED isolation mode before 100 was committed.   Doing first read of this row it will read 50,  now if it reads the row second time, after transaction 100 was committed it will see this row because it will know transaction 100 was committed when given read operation was started. </p>
<p>Note:  These are far from all functions which MVCC storage engines may place on these identifiers. This is not extensive list but just to give you some examples to understand why do you need all of them.</p>
    <hr noshade style="margin:0;height:1px" />
    <p>Entry posted by peter |
      <a href="http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/#comments">3 comments</a></p>
    <p>Add to: <a href="http://del.icio.us/post?url=http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/&amp;title=MVCC:  Transaction IDs, Log Sequence numbers and Snapshots" title="Bookmark this post on del.icio.us"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/delicious.png" alt="delicious" /></a> | <a href="http://digg.com/submit?phase=2&amp;url=http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/&amp;title=MVCC:  Transaction IDs, Log Sequence numbers and Snapshots" title="Digg this post on Digg.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/digg.png" alt="digg" /></a> | <a href="http://reddit.com/submit?url=http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/&amp;title=MVCC:  Transaction IDs, Log Sequence numbers and Snapshots" title="Submit this post on reddit.com"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/reddit.png" alt="reddit" /></a> | <a href="http://www.netscape.com/submit/?U=http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/&amp;T=MVCC:  Transaction IDs, Log Sequence numbers and Snapshots" title="Vote for this article on Netscape"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/netscape.gif" alt="netscape" /></a> | <a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/&amp;title=MVCC:  Transaction IDs, Log Sequence numbers and Snapshots" title="Add to Google Bookmarks"><img src="http://www.mysqlperformanceblog.com/wp-content/themes/boxy-but-gold/images/google.png" alt="Google Bookmarks" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.mysqlperformanceblog.com/2007/12/19/mvcc-transaction-ids-log-sequence-numbers-and-snapshots/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
