<?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>Ramblings &#187; ndb</title>
	<atom:link href="http://www.flamingspork.com/blog/tag/ndb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flamingspork.com/blog</link>
	<description>Ramblings which occasionally resemble reality. This is the blog of Stewart Smith.</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:21:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AlsoSQL</title>
		<link>http://www.flamingspork.com/blog/2010/04/08/alsosql/</link>
		<comments>http://www.flamingspork.com/blog/2010/04/08/alsosql/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 04:39:32 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[alsosql]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[ndbapi]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1711</guid>
		<description><![CDATA[So there&#8217;s a bit of a swelling around the idea of NoSQL. That is, databases that don&#8217;t have an SQL interface in front of them &#8211; with the promise of better performance. With a well designed backend, this is no doubt the case. A flexible query language is rather useful though. I think we&#8217;ll see [...]]]></description>
			<content:encoded><![CDATA[<p>So there&#8217;s a bit of a swelling around the idea of NoSQL. That is, databases that don&#8217;t have an SQL interface in front of them &#8211; with the promise of better performance. With a well designed backend, this is no doubt the case.</p>
<p>A flexible query language is rather useful though. I think we&#8217;ll see the rise of AlsoSQL. That is systems that present a fast and simple protocol along with a SQL interface.</p>
<p>This hybrid system has seen use for many years. <a href="http://mysql.com/products/database/cluster/">MySQL Cluster</a> is one such example. SQL through MySQL Server, NoSQL through <a href="http://dev.mysql.com/doc/ndbapi/en/index.html">NDB API</a>.</p>
<p>With <a href="http://drizzle.org">Drizzle</a>, I feel we&#8217;ll be in a pretty good position to offer non-sql based protocols and access methods to existing storage engines.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2010/04/08/alsosql/&amp;t=AlsoSQL" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=AlsoSQL+-+http://b2l.me/w9y4v&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2010/04/08/alsosql/&amp;title=AlsoSQL" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2010/04/08/alsosql/&amp;title=AlsoSQL" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2010/04/08/alsosql/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2010/04/08/alsosql/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Continuing the journey</title>
		<link>http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/</link>
		<comments>http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 07:42:46 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[life, the universe and everything]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[work et al]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rackspace]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1752</guid>
		<description><![CDATA[A couple of months ago (December 1st for those playing along at home) it marked five years to the day that I started at MySQL AB (now Sun, now Oracle). A good part of me is really surprised it was for that long and other parts surprised it wasn&#8217;t longer. Through MySQL and Sun, I [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago (December 1st for those playing along at home) it marked five years to the day that I started at <a href="http://www.mysql.com">MySQL AB</a> (<del datetime="2010-03-10T03:09:15+00:00">now <a href="http://www.sun.com">Sun</a></del>, now <a href="http://www.oracle.com">Oracle</a>). A good part of me is really surprised it was for that long and other parts surprised it wasn&#8217;t longer. Through MySQL and Sun, I met some pretty amazing people, worked with some really smart ones and formed really solid and awesome friendships. Of course, not everything was perfect (sometimes not even close), but we did have some fun.</p>
<p>Up until November 2008 (that&#8217;s 3 years and 11 months for those playing at home) I worked on <a href="http://www.mysql.com/cluster">MySQL Cluster</a>. Still love the product and love how much better we&#8217;re making Drizzle so it&#8217;ll be the best SQL interface to NDB :)</p>
<p>The ideas behind Drizzle had been talked about for a while&#8230; and with my experience with internals of the MySQL server, I thought that some change and dramatic improvement was sorely needed.</p>
<p>Then, in 2008, Brian created a tree. I was soon sending in patches at nights, we announced to the whole world at OSCON and it captured a lot of attention.</p>
<p>Since November 2008 I&#8217;ve been working on <a href="http://drizzle.org">Drizzle</a> full time. It was absolutely awesome that I had the opportunity to spend all my days hacking on Drizzle &#8211; both directly with fantastic people and for fantastic people.</p>
<p>But&#8230; the Sun set&#8230; which was exciting and sad at the same time.</p>
<p>Never to fear! There were plenty of places wanting Drizzle hackers (and MySQL hackers). For me, it came down to this: &#8220;real artists ship&#8221;. While there were other places where I would no doubt be happy and work on something really cool, the only way I could end up working out where I should really be was: what is the best way to have Drizzle make a stable release that we&#8217;d see be suitable for deployment? So, Where Am I Now?</p>
<p><a href="http://www.rackspacecloud.com">Rackspace</a>.</p>
<p>Where I&#8217;ll again be spending all my time hacking Drizzle.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/&amp;t=Continuing+the+journey" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Continuing+the+journey+-+http://b2l.me/w93de&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/&amp;title=Continuing+the+journey" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/&amp;title=Continuing+the+journey" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2010/03/11/continuing-the-journey/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>NDB$INFO with SQL hits beta</title>
		<link>http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/</link>
		<comments>http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 01:37:20 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[MySQL Cluster]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[ndb$info]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1783</guid>
		<description><![CDATA[﻿Bernhard blogged over at http://ocklin.blogspot.com/2010/02/mysql-cluster-711-is-there.html that MySQL Cluster 7.1.1 Beta has been released. The big feature (from my point of view) is the SQL interface on top of NDB$INFO. This means there is now full infrastructure from the NDB data nodes right out to SQL in the MySQL Server for adding monitoring to any bit [...]]]></description>
			<content:encoded><![CDATA[<p>﻿<a href="http://ocklin.blogspot.com">Bernhard</a> blogged over at<a href="http://ocklin.blogspot.com/2010/02/mysql-cluster-711-is-there.html"> http://ocklin.blogspot.com/2010/02/mysql-cluster-711-is-there.html</a> that <a href="ftp://ftp.mysql.com/pub/mysql/download/mysql-5.1.41-ndb-7.1.1-beta.tgz">MySQL Cluster 7.1.1 Beta</a> has been released. The big feature (from my point of view) is the SQL interface on top of NDB$INFO. This means there is now full infrastructure from the NDB data nodes right out to SQL in the MySQL Server for adding monitoring to any bit of the internals of the data nodes.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/&amp;t=NDB%24INFO+with+SQL+hits+beta" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=NDB%24INFO+with+SQL+hits+beta+-+http://b2l.me/xa4hs&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/&amp;title=NDB%24INFO+with+SQL+hits+beta" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/&amp;title=NDB%24INFO+with+SQL+hits+beta" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2010/02/03/ndbinfo-with-sql-hits-beta/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Drizzle FRM replacement: the table proto</title>
		<link>http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/</link>
		<comments>http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 10:50:10 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[drizzle]]></category>
		<category><![CDATA[work et al]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[frm]]></category>
		<category><![CDATA[INFORMATION_SCHEMA]]></category>
		<category><![CDATA[myisam]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[protobuf]]></category>
		<category><![CDATA[unireg]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1745</guid>
		<description><![CDATA[Drizzle originally inherited the FRM file from MySQL (which inherited it from UNIREG). The FRM file stores metadata about a table; what columns it has, what type those columns are, what indexes, any default values, comments etc are all stored in the FRM. In the days of MyISAM, this worked relatively well. The row data [...]]]></description>
			<content:encoded><![CDATA[<p>Drizzle originally inherited the FRM file from MySQL (which inherited it from UNIREG). The FRM file stores metadata about a table; what columns it has, what type those columns are, what indexes, any default values, comments etc are all stored in the FRM. In the days of MyISAM, this worked relatively well. The row data was stored in table.MYD, indexes on top of it in table.MYI and information about the format of the row was<br />
in table.FRM. Since MyISAM itself wasn&#8217;t crash safe, it didn&#8217;t really matter if creating/deleting the FRM file along with the table was either.</p>
<p>As more sophisticated engines were introduced (e.g. InnoDB) that had their own data dictionary, there started to be more of a problem. There were now two places storing information about a table: the FRM file and the data dictionary specific to the engine. Even if the data dictionary of the storage engine was crash safe, the FRM file was not plugged into that, so you could end up in a situation where the storage engine<br />
recovered from a crash okay, but the FRM was incorrect for what the engine recovered to. This would always require manual intervention to find out what went wrong and then fix it (in some rather unusual ways).</p>
<p>When the MySQL Cluster (NDB) engine was introduced, a new set of problems arose. Now the MySQL server was connecting to an existing database, where tables could be created on other nodes connected to the cluster. You now not only had the problems of crash recovery, but the problems of keeping the FRM files in sync across many nodes, requiring<br />
all sorts of interesting solutions that, for the most part, do work.</p>
<p>The &#8220;obvious&#8221; solution to some of these problems would be for an engine to write out an FRM file itself. This is much easier said than done. The file format was never created to be read and written by multiple pieces of software, the code that did the reading and writing inside the server was not reusable elsewhere and the only documentation (that<br />
wasn&#8217;t a decent chunk of the MySQL source tree) is the rather incomplete definition in the MySQL Internals wiki (http://forge.mysql.com/wiki/MySQL_Internals_File_Formats) &#8211; not nearly enough to write a correct FRM file as the specifics are very, very odd.</p>
<p>Our goals for reworking the metadata system in Drizzle were: to allow engines to own their own metadata (removing any opportunity to have inconsistencies between the engine and the &#8216;FRM&#8217;) and for engines without their own data dictionary, to replace the FRM file format with something simple and well documented.</p>
<p>One option was to use SQL as the standard storage format, but it is rather non-trivial and expensive to parse &#8211; especially if we were to use it as the preferred way of talking table definitions with storage engines. We had been looking at the protobuf library<br />
(http://code.google.com/p/protobuf/) ever since its first release and it has a number of very nice characteristics: a description language of a data structure that is then used to generate APIs for reading and writing it in a number of programming languages and a standard (documented) way to serialize the data structure.</p>
<p>After a bit of discussion, we arrived at a good outline for the table definition proto. The current one can always be found in the Drizzle source tree at  drizzled/message/table.proto. The current format is very close to final (i.e. one that we&#8217;ll suppport upgrades from).</p>
<p>The process of modifying the Drizzle code base so that it would write (and read) a file format different to the FRM isn&#8217;t worth going too much into here although there were some interesting hurdles to overcome. An interesting one was the FRM file contains a binary image of the default row for the table (which is in the row format that the server uses); we now store the default value for each column in the proto and generate the default row when we read the proto. Another interesting one was removing and refactoring &#8220;pack_flag&#8221; &#8211; the details of which should only be extracted from Jay or Stewart with a liberal application of fine ale.</p>
<p>The end result is that we now have storage engines that are completely responsible for their own metadata. One example is the ARCHIVE engine. In the CREATE TABLE code path, the ARCHIVE storage engine gets the table definition in an object that represents the table proto. It can examine the parameters it needs to and then either store the proto directly, or convert it into its own format. Since ARCHIVE is simple, it just stores<br />
the table proto in a serialised form (using a standard function provided by the protobuf library) and stores it in the .ARZ data file for the table. This instantly makes the ARCHIVE storage engine crash safe for CREATE and DROP table as there is only 1 file on disk, so no two files to get out of sync.</p>
<p>If an engine does not have its own data dictionary, it can still use the default implementation which just stores the serialised table proto in a file on disk.</p>
<p>We can also now use this interface to move INFORMATION_SCHEMA into its own storage engine. This means we can remove a lot of special case code throughout the server for INFORMATION_SCHEMA and instead just have a INFORMATION_SCHEMA storage engine that says it has the following tables in the INFORMATION_SCHEMA database. Because the table definition is now in a documented format with a standard API, this becomes a relatively trivial exercise.</p>
<p>What we&#8217;re all looking forward to is when the InnoDB data dictionary is linked into the new interface and we can have a truly crash safe database server.</p>
<p>Another wonderful side effect is since we now have a standard data structure for representing a table definition, we can integrate this with the replication system. In the &#8220;near&#8221; future, we can represent a CREATE TABLE in the replication stream as a table proto and not the raw SQL. If you were wanting to apply the replication stream to a different database server, you then only have to write a table proto to SQL<br />
converter. If the target database system doesn&#8217;t do SQL at all, you could generate API calls to create the table.</p>
<p>So we now have a rather flexible system in place, with the code implementing it being increasingly simple and possible to be &#8220;obviously correct&#8221;.</p>
<p>Things that easily fall out of this work that people have written about:<br />
- CREATE TABLE LIKE with ENGINE clause<br />
<a href="http://krow.livejournal.com/671235.html"> http://krow.livejournal.com/671235.html</a><br />
- table_raw_reader &#8211; looking at the raw representation of table metadata<br />
<a href="http://www.flamingspork.com/blog/2009/10/01/table_raw_reader-reading-the-table-proto-from-disk-and-examining-everything/"> http://www.flamingspork.com/blog/2009/10/01/table_raw_reader-reading-the-table-proto-from-disk-and-examining-everything/</a><br />
- Table discovery<br />
<a href="http://www.flamingspork.com/blog/2009/07/29/table-discovery-for-drizzle-take-2-now-merged/"> http://www.flamingspork.com/blog/2009/07/29/table-discovery-for-drizzle-take-2-now-merged/</a></p>
<p>Some more info:<br />
<a href="http://krow.livejournal.com/642329.html"> http://krow.livejournal.com/642329.html</a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/&amp;t=Drizzle+FRM+replacement%3A+the+table+proto" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Drizzle+FRM+replacement%3A+the+table+proto+-+http://b2l.me/w8kv8&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/&amp;title=Drizzle+FRM+replacement%3A+the+table+proto" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/&amp;title=Drizzle+FRM+replacement%3A+the+table+proto" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/12/09/drizzle-frm-replacement-the-table-proto/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NDB Kernel size over releases</title>
		<link>http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/</link>
		<comments>http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/#comments</comments>
		<pubDate>Fri, 15 May 2009 10:05:47 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[sloccount]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1639</guid>
		<description><![CDATA[So Jonas pointed out that the NDB kernel hasn&#8217;t changed too much in size over releases. Let&#8217;s have a look: In fact, the size went down slightly from 4.1 to 5.0. In this, 6.4 and 7.0 are the same thing but appear twice for completeness. You can see the raw results in the spreadsheet here. [...]]]></description>
			<content:encoded><![CDATA[<p>So <a href="http://www.flamingspork.com/blog/2009/05/15/size-of-storage-engines/comment-page-1/#comment-90166">Jonas pointed out</a> that the NDB kernel hasn&#8217;t changed too much in size over releases. Let&#8217;s have a look:</p>
<p><img class="alignnone" title="NDB Kernel code size" src="http://spreadsheets.google.com/pub?key=rb3gswEGOF8WZlKMJtLr7ug&amp;oid=1&amp;output=image" alt="" width="584" height="385" /></p>
<p>In fact, the size went <strong>down</strong> slightly from 4.1 to 5.0. In this, 6.4 and 7.0 are the same thing but appear twice for completeness.</p>
<p>You can see the raw results in the spreadsheet <a href="http://spreadsheets.google.com/pub?key=rb3gswEGOF8WZlKMJtLr7ug">here</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/&amp;t=NDB+Kernel+size+over+releases" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=NDB+Kernel+size+over+releases+-+http://b2l.me/w86z3&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/&amp;title=NDB+Kernel+size+over+releases" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/&amp;title=NDB+Kernel+size+over+releases" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/05/15/ndb-kernel-size-over-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feedback from MySQL Cluster tutorial</title>
		<link>http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/</link>
		<comments>http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 04:14:31 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[mysqlconf]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1615</guid>
		<description><![CDATA[Way back on Monday (at the MySQL Conference and Expo), I gave a full day tutorial on MySQL Cluster. I awoke early in the morning to a &#8220;oh ha ha&#8221; URL in an IM; but no, it wasn&#8217;t jetlag playing tricks with me. Luckily, this didn&#8217;t take much (if anything) away from the purpose of [...]]]></description>
			<content:encoded><![CDATA[<p>Way back on Monday (at the <a href="http://www.mysqlconf.com">MySQL Conference and Expo</a>), I gave a <a href="http://www.mysqlconf.com/mysql2009/public/schedule/detail/6688">full day tutorial</a> on <a href="http://www.mysql.com/cluster">MySQL Cluster</a>. I awoke early in the morning to a &#8220;<a href="http://www.oracle.com/sun/index.html">oh ha ha</a>&#8221; URL in an IM; but no, it wasn&#8217;t jetlag playing tricks with me. Luckily, this didn&#8217;t take much (if anything) away from the purpose of the day: teaching people about NDB.</p>
<p>Distracting-and-this-time-really-annoying-thing-of-the-day-2: It seems that O&#8217;Reilly had cut back on power this year, and there were <strong>no</strong> power boards in the room. A full day <strong>interactive</strong> tutorial, and nowhere to plug in laptops. Hrrm.. Luckily, having over the many years I&#8217;ve been speaking at this event, I&#8217;ve gotten to know the AV guys okay, and asked them. They totally deserve a medal. Tutorial started at 8:30, I noticed at 7:30, and it was all fixed by 7:45. The front half of the room (enough for everyone coming) had enough power for everyone. It was quite okay to bunch everybody up &#8211; means I have to run around less.</p>
<p>This years tutorial was modified from last year (and that does take time, even though I&#8217;ve given it many times before). I wanted to remove out of date things, trim bits down (to better fit into the time we have, based on more experience on how long it takes to get interactive parts done) and add a bit.</p>
<p>When we got to the end of the day (yes, I ran over&#8230; and everybody stayed, so either I&#8217;m really scary or the material is really interesting) I pleaded for feedback. It&#8217;s amazingly scary doing an interactive tutorial. You&#8217;re placing the success of the session not so much on you, but on everyone who&#8217;s come to it.</p>
<p>Sometimes I&#8217;ve gotten not much feedback at all; this time was different. I spoke to a number of people afterwards (and some via email) and got some really good suggestions for small changes that would have greatly enhanced the day for them. I was pleased that they also really enjoyed the tutorial and liked the interactivity. I (and it seems a great many others) do not much like tutorials that are just long talks.</p>
<p>People walked out of my tutorial with a good overview of what MySQL Cluster was, how to set one up, use one, do a bit of admin and some of how it works.</p>
<p>I even dragged Jonas up to explain in great detail the 2 phase commit protocol for transactions. Of course, this is detail you don&#8217;t ever need to know to deploy &#8211; but people are intersted in internals.</p>
<p>So far the session has received an average of 4 stars in evaluations (four five star, two four star and one two star). I&#8217;d be really interested in feedback from the person who gave two stars, as this may mean I missed getting something done for them (e.g. providing information, help etc). Even though it is hard to spread yourself around a room of 60-ish-plus people, I do like to do it well. There is the other possibility of people not coming prepared, which will mean they may be bored for a lot of the day if they don&#8217;t jump in with another group and help learn that way.</p>
<p>So, I&#8217;m rather happy with how my first session went.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/&amp;t=Feedback+from+MySQL+Cluster+tutorial" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Feedback+from+MySQL+Cluster+tutorial+-+File: /data/app/webapp/functions.php<br />Line: 7<br />Message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11)&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/&amp;title=Feedback+from+MySQL+Cluster+tutorial" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/&amp;title=Feedback+from+MySQL+Cluster+tutorial" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/04/26/feedback-from-mysql-cluster-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL Cluster Tutorial</title>
		<link>http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/</link>
		<comments>http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 04:12:01 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[ndb]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1597</guid>
		<description><![CDATA[This year I am again giving a MySQL Cluster Tutorial at the MySQL Conference and Expo. As those who have attended before can tell you, this is a hands on tutorial. I don&#8217;t just stand up the front and talk at you for a day, that would be very boring (for all of us). While [...]]]></description>
			<content:encoded><![CDATA[<p>This year I am again giving a <a href="http://en.oreilly.com/mysql2009/public/schedule/detail/6688">MySQL Cluster Tutorial</a> at the <a href="http://www.mysqlconf.com">MySQL Conference and Expo</a>. As those who have attended before can tell you, this is a <strong>hands on</strong> tutorial. I don&#8217;t just stand up the front and talk at you for a day, that would be very boring (for all of us). While there is a good amount of presented material (there is a decent amount of theory to get through), there is a large component that involves setting up a cluster, putting data in, getting data out, backup, restore.</p>
<p>So if you&#8217;re wanting to learn about MySQL Cluster in a nice and friendly hands-on environment, I can recommend coming to my tutorial.</p>
<p>The tutorial isn&#8217;t the be-all and end-all tutorial. It does not teach you everything. It does give you a decent introduction though.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/&amp;t=MySQL+Cluster+Tutorial" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=MySQL+Cluster+Tutorial+-+http://b2l.me/xaun7&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/&amp;title=MySQL+Cluster+Tutorial" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/&amp;title=MySQL+Cluster+Tutorial" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/03/27/mysql-cluster-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux.conf.au 2009 wrap-up (incl Open Source Databases Mini-conf): Day 0-1</title>
		<link>http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/</link>
		<comments>http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 02:47:42 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[life, the universe and everything]]></category>
		<category><![CDATA[linux-aus]]></category>
		<category><![CDATA[linux.conf.au]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ndb]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1400</guid>
		<description><![CDATA[It&#8217;s no secret that I love linux.conf.au. My first was linux.conf.au 2003, in Perth and I&#8217;ve been to every one since (there are at least two people who&#8217;ve been to every single one, including CALU as it was called in 1999). I&#8217;ve been on the board of Linux Australia for some insane proportion of the [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s no secret that I love <a href="http://conf.linux.org.au">linux.conf.au</a>. My first was <a href="http://www.linux.org.au/conf/2003/">linux.conf.au 2003</a>, in Perth and I&#8217;ve been to every one since (there are at least two people who&#8217;ve been to every single one, including <a href="http://www.linux.org.au/conf/1999/index.phtml">CALU</a> as it was called in 1999).</p>
<p>I&#8217;ve been on the board of <a href="http://www.linux.org.au">Linux Australia</a> for some insane proportion of the years since then (joining in 2003). Linux Australia is the not-for-profit community organisation that puts on linux.conf.au. It&#8217;s all volunteers and amazingly enough we have more than one group of people wanting to put on linux.conf.au each year!</p>
<p>This year, we <a href="http://www.marchsouth.org">Marched South</a> to Hobart.</p>
<p>Here I detail what I saw, what I wish I saw and whatever else comes to mind.</p>
<h2>Sunday &#8211; Before the conference</h2>
<p>Ran into <a href="http://www.gag.com/~bdale/">Bdale</a> while checking in. Short flight down. A million and one people on the plane and on the ground that I knew. It must be linux.conf.au.</p>
<p>Seeing way too many awesome people I know, checking into accommodation (oh my, what a hill), registering for conf, beer and then off to a &#8220;ghosts of conferences past&#8221; dinner &#8211; where a few people who had organised previous linux.conf.au&#8217;s were hastily gathered together to chat to part of the 2010 team.</p>
<h2>Monday &#8211; Open Source Databases Miniconf Day 1</h2>
<p>Oh, that&#8217;s right &#8211; I&#8217;m running the OSDB Miniconf :)</p>
<p>First up, <a href="http://bonglonglong.com/">Monty Taylor</a> spoke on &#8220;NDB/Bindings &#8211; Use the MySQL Cluster Direct API from languages you actually like for fun and profit&#8221;. Possibly taking the prize for the longest talk title of the conference. The NDB API is not SQL, it&#8217;s what the MySQL server (and one day, when Monty and I get around to it, Drizzle) translates SQL into for NDB. That being said, you can (pretty much always) write NDB API code that dramatically outperforms equivilent SQL (for a variety of reasons). Monty maintains the NDB/Bindings project that lets you use languages other than C++ for the NDB API.</p>
<p>At the same time as Monty was speaking, I wish I&#8217;d been able to fork() and go and see &#8220;<a href="http://www.rdrop.com/users/paulmck/scalability/paper/IsParallelProgrammingHard.2009.01.19a.pdf">Is Parallel Programming Hard, And, If So, Why?</a>&#8221;      <em>by</em> <span class="by_speaker"><a href="http://www.rdrop.com/users/paulmck/">Paul McKenney</a> and <a href="http://www.stillhq.com/">Michael Still</a> talking about <a href="http://www.stillhq.com/mythtv/mythnettv/">MythNetTV</a> (pull RSS feeds of video in as MythTV programs).</span></p>
<p>After morning tea, we were meant to have &#8220;InnoDB scaling up and performance&#8221;       <em>by</em> Bruce Huang, but he was a no-show. Hint: if you don&#8217;t want bad things to be said about you by conference organisers, either show up or let them know you&#8217;re not able to make it.</p>
<p>Instead, we led a crazy Q&amp;A type session around the room which was a whole lot of fun. Really a &#8220;ask the experts&#8221; meets running up-and-down stairs with a microphone.</p>
<p>Next up, <a href="http://wiki.lentz.com.au/">Arjen Lentz</a> who runs <a href="http://www.openquery.com.au">Open Query</a> spoke on &#8220;<a href="http://ourdelta.org/">OurDelta</a>: Builds for MySQL&#8221;. The best way to describe OurDelta is a &#8220;distribution of MySQL&#8221;. It&#8217;s the MySQL server plus a bunch of patches provided by various people that haven&#8217;t yet made it into the main source tree (for any number of reasons).</p>
<p>At the same time (if you&#8217;ve never been to linux.conf.au, you&#8217;ll find that you often want to be in at least 3 places at once) I would have really liked to see &#8220;MythTV Internals by Nigel Pearson&#8221; (I co-wrote <a href="http://www.amazon.com/dp/1590597796?tag=flamin-20&amp;camp=14573&amp;creative=327641&amp;linkCode=as1&amp;creativeASIN=1590597796&amp;adid=0GFMANM2VXXW6XJVX6DS&amp;">Practical MythTV</a> with <a href="http://www.stillhq.com/">Michael Still</a>, which is having a &#8220;second edition&#8221; in wiki form over at <a href="http://www.mythtvbook.com/">http://www.mythtvbook.com/</a>) as well as the panel on geek parenting as this may be something I&#8217;m one day faced with.</p>
<p>Up next: Russell Coker filled in for Kaigai (same talk, different speaker) to talk on The Security-Enhanced PostgreSQL &#8211; &#8220;System-wide consistency&#8221; in access controls. I found this quite interesting and different approaches to database security are worth looking at. Modern applications (read: web applications) don&#8217;t map their uses to database users <strong>at all</strong>. There are usually two users on the database server: the super user and the user that the app uses. It would be nice to have a good solution for those who want it.</p>
<p>Again, If I had the ability to be in two places at once, I would have also seen &#8220;How I Learned To Stop Worrying And Love ACPI&#8221; by <a href="http://www.linuxjournal.com/content/linuxconfau-penguin-dinner">the extremely handsome</a> <a href="http://mjg59.livejournal.com/">Matthew Garrett</a>.</p>
<p><a href="http://en.wikipedia.org/wiki/Michael_Widenius">Monty Widenius</a> (<a href="http://monty-says.blogspot.com/">blog here</a> &#8211; and yes, we have two Monty&#8217;s now&#8230; which does cause confusion) talking about the <a href="http://forge.mysql.com/wiki/Maria_Docs">Maria</a> storage engine. Maria is based on MyISAM, but adding crash safety and transactions (among other things).</p>
<p>Again, if I was able to be in several places at once I would have also seen <a href="http://ozlabs.org/~rusty/">Rusty</a>&#8216;s &#8220;Large CPUmasks&#8221;, Nathan Scott talking about &#8220;System level performance management with <a href="http://oss.sgi.com/projects/pcp/">PCP</a>&#8221; and Bdale&#8217;s &#8220;Collaborating Successfully with large corporations&#8221;.</p>
<p>An awesome start to the conference.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/&amp;t=linux.conf.au+2009+wrap-up+%28incl+Open+Source+Databases+Mini-conf%29%3A+Day+0-1" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=linux.conf.au+2009+wrap-up+%28incl+Open+Source+Databases+Mini-conf%29%3A+Day+0-1+-+http://b2l.me/xcx4z&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/&amp;title=linux.conf.au+2009+wrap-up+%28incl+Open+Source+Databases+Mini-conf%29%3A+Day+0-1" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/&amp;title=linux.conf.au+2009+wrap-up+%28incl+Open+Source+Databases+Mini-conf%29%3A+Day+0-1" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/02/20/linuxconfau-2009-wrap-up-incl-open-source-databases-mini-conf-day-0-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>row id in MySQL and Drizzle (and the engines)</title>
		<link>http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/</link>
		<comments>http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 11:08:07 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ndb]]></category>
		<category><![CDATA[rowid]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1383</guid>
		<description><![CDATA[Some database engines have a fundamental concept of a row id. The row id is everything you need to know to locate a row. Common uses include secondary indexes (key is what&#8217;s indexed, value is rowid which you then use to lookup the row). One design is the InnoDB method of having secondary indexes have [...]]]></description>
			<content:encoded><![CDATA[<p>Some database engines have a fundamental concept of a row id. The row id is everything you need to know to locate a row. Common uses include secondary indexes (key is what&#8217;s indexed, value is rowid which you then use to lookup the row).</p>
<p>One design is the InnoDB method of having secondary indexes have the value in the index be the primary key of the row. Another is to store the rowid instead. Usually (or often&#8230; or sometimes&#8230;) rowid is much smaller than the pkey of the row. This is how innodb can answer some queries just out of the index. If it used rowid, it may involve more IO to answer the query. All this is irrelevant if you never want just the primary key from a secondary index.</p>
<p>Some engines are designed from the start to have rowid, others it&#8217;s added later (e.g. NDB).</p>
<p>Anyway&#8230; all beside the point. Did you know you can do this in mysql or drizzle:</p>
<pre>drizzle&gt; create table t1 (a int primary key);
Query OK, 0 rows affected (0.02 sec)

drizzle&gt; insert into t1 (a) values (1);
Query OK, 1 row affected (0.01 sec)

drizzle&gt; select _rowid from t1;
+--------+
| _rowid |
+--------+
|      1 |
+--------+
1 row in set (0.00 sec)</pre>
<p>Is that the rowid from the engine? No (although at least NDB will let you select the real ROWID through a pseudo column through NDBAPI). Quoting from the <a href="http://dev.mysql.com/doc/refman/5.1/en/create-table.html">MySQL manual</a>:</p>
<blockquote><p>If a <code class="literal">PRIMARY KEY</code> or           <code class="literal">UNIQUE</code> index consists of only one column           that has an integer type, you can also refer to the column as           <code class="literal">_rowid</code> in           <a title="12.2.8. SELECT Syntax" href="http://dev.mysql.com/doc/refman/5.1/en/select.html"><code class="literal">SELECT</code></a> statements.</p></blockquote>
<p>Unfortunately, this isn&#8217;t correct&#8230; as this lovely bit of &#8220;oh my, what an excellent way to obfuscate my database app!&#8221; shows:</p>
<p>drizzle&gt; create table t1 (a int primary key, b varchar(100));<br />
Query OK, 0 rows affected (0.02 sec)</p>
<p>drizzle&gt; insert into t1 values (1,&#8221;foo&#8221;);<br />
Query OK, 1 row affected (0.00 sec)</p>
<p>drizzle&gt; update t1 set b=&#8221;foobar!&#8221; where _rowid=1;<br />
Query OK, 1 row affected (0.00 sec)<br />
Rows matched: 1  Changed: 1  Warnings: 0</p>
<p>drizzle&gt; select * from t1;<br />
+&#8212;+&#8212;&#8212;&#8212;+<br />
| a | b       |<br />
+&#8212;+&#8212;&#8212;&#8212;+<br />
| 1 | foobar! |<br />
+&#8212;+&#8212;&#8212;&#8212;+<br />
1 row in set (0.00 sec)</p>
<p>So how is this implemented? In two places: in sql_base.cc find_field_in_table() and in table.cc during FRM parsing (this is how I found it). We can even do things <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/pseudocolumns008.htm">Oracle can&#8217;t</a> (insert, update and delete):</p>
<pre>drizzle&gt; update t1 set a=2 where _rowid=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

drizzle&gt; select * from t1;
+---+---------+
| a | b       |
+---+---------+
| 2 | foobar! |
+---+---------+
1 row in set (0.00 sec)

drizzle&gt; update t1 set _rowid=3 where _rowid=2;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

drizzle&gt; select * from t1;
+---+---------+
| a | b       |
+---+---------+
| 3 | foobar! |
+---+---------+
1 row in set (0.00 sec)</pre>
<p>SQLite also has something similar (see the <a href="http://www.sqlite.org/autoinc.html">autoinc docs</a>).</p>
<p>I do wonder if anybody uses this functionality. It&#8217;s even tested (I was quite shocked at this) in the auto_increment and heap_auto_increment tests.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/&amp;t=row+id+in+MySQL+and+Drizzle+%28and+the+engines%29" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=row+id+in+MySQL+and+Drizzle+%28and+the+engines%29+-+File: /data/app/webapp/functions.php<br />Line: 7<br />Message: Too many connections&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/&amp;title=row+id+in+MySQL+and+Drizzle+%28and+the+engines%29" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/&amp;title=row+id+in+MySQL+and+Drizzle+%28and+the+engines%29" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/02/02/row-id-in-mysql-and-drizzle-and-the-engines/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>People on IRC as some measure of a project</title>
		<link>http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/</link>
		<comments>http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 04:40:20 +0000</pubDate>
		<dc:creator>Stewart Smith</dc:creator>
				<category><![CDATA[drizzle]]></category>
		<category><![CDATA[linux.conf.au]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ndb]]></category>

		<guid isPermaLink="false">http://www.flamingspork.com/blog/?p=1347</guid>
		<description><![CDATA[#mysql isn&#8217;t too fair to include, as it&#8217;s really about users, not dev. #mysql-ndb is there because i heart ndb. Oh, and linux.conf.au is there because it&#8217;s *awesome* and you should go. Totally unscientific due to i&#8217;m only taking a sample once and whatever&#8230; but it kinda interests me&#8230; Share this on Facebook Tweet This! [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="People in IRC channels" src="http://spreadsheets.google.com/pub?key=pvD6nw6CQOO7xiL2Fxkl0Dw&amp;oid=1&amp;output=image" alt="" width="450" height="320" /></p>
<p>#mysql isn&#8217;t too fair to include, as it&#8217;s really about users, not dev. #mysql-ndb is there because i heart ndb.</p>
<p><img class="alignnone" title="dev irc channels" src="http://spreadsheets.google.com/pub?key=pvD6nw6CQOO7xiL2Fxkl0Dw&amp;oid=2&amp;output=image" alt="" width="450" height="320" /></p>
<p>Oh, and <a href="http://conf.linux.org.au">linux.conf.au</a> is there because it&#8217;s *awesome* and you should go.</p>
<p>Totally unscientific due to i&#8217;m only taking a sample once and whatever&#8230; but it kinda interests me&#8230;</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/&amp;t=People+on+IRC+as+some+measure+of+a+project" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=People+on+IRC+as+some+measure+of+a+project+-+File: /data/app/webapp/functions.php<br />Line: 66<br />Message: Duplicate entry 'xcx5C' for key 'code'&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/&amp;title=People+on+IRC+as+some+measure+of+a+project" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/&amp;title=People+on+IRC+as+some+measure+of+a+project" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.flamingspork.com/blog/2009/01/14/people-on-irc-as-some-measure-of-a-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
