<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Daniel Bartholomew &#187; MariaDB</title>
	<atom:link href="http://daniel-bartholomew.com/wordpress/tag/mariadb/feed/" rel="self" type="application/rss+xml" />
	<link>http://daniel-bartholomew.com/wordpress</link>
	<description></description>
	<lastBuildDate>Mon, 26 Sep 2011 19:13:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>		<item>
		<title>Road to MariaDB 5.2: Virtual Columns</title>
		<link>http://daniel-bartholomew.com/wordpress/2010/09/road-to-mariadb-5-2-virtual-columns/</link>
		<comments>http://daniel-bartholomew.com/wordpress/2010/09/road-to-mariadb-5-2-virtual-columns/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 06:36:48 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monty Program Ab]]></category>
		<category><![CDATA[MariaDB]]></category>

		<guid isPermaLink="false">http://daniel-bartholomew.com/wordpress/?p=299</guid>
		<description><![CDATA[MariaDB 5.2 is almost here. The gamma release (think "RC") was released on 28 Sep and the stable release will follow just as soon as the developers are happy with it.

One of the best new features of MariaDB 5.2 ...]]></description>
			<content:encoded><![CDATA[<p>MariaDB 5.2 is almost here. The <a href="http://kb.askmonty.org/v/mariadb-522-release-notes">gamma release</a> (think &#8220;RC&#8221;) was released on 28 Sep and the stable release will follow just as soon as the developers are happy with it.</p>
<p>One of the best new features of MariaDB 5.2 is Virtual Columns.</p>
<p>What are virtual columns you say?</p>
<p>Well, I suppose I should start by backing up a bit and saying that there are two types of virtual columns: <strong>VIRTUAL</strong> virtual columns and <strong>PERSISTENT</strong> virtual columns. (I know, I know&#8230; saying <em>virtual</em> twice is a little strange).</p>
<p>Ignoring the semantics, I think of <strong>virtual</strong> virtual columns as truly virtual; their value is not stored and they have no actual existence apart from the table definition. They act like regular columns in queries, but their content is always calculated on the fly and never written to disk. You might be thinking that this could lead to a performance penalty; so to help with performance, if an SQL query doesn&#8217;t reference a <strong>virtual</strong> virtual column, the value is not calculated.</p>
<p><strong>Persistent</strong> virtual columns are half-way between being truly virtual and being regular columns. The main difference compared to virtual virtual columns is that the calculated data is actually stored in the database.</p>
<p>More information on the syntax to use when creating a table with virtual columns, and some things to be aware of, see the <a href="http://kb.askmonty.org/v/virtual-columns">Virtual Columns</a> entry in the Askmonty.org Knowledgebase.</p>
<p>Enough talk, let&#8217;s see virtual columns in action.</p>
<div style="border:1px solid #600;color:#600;background:#fcc;padding:.5em;margin:.5em;"><strong><em>Warning:</em></strong> The examples below are simplistic. In my defense, my job is to document how a feature works, not to wow anyone with all of the cool ways a feature can or could be used (and abused). Let me just say the examples work for my purposes here, but are not very useful, imaginative, or practical. <img src='http://daniel-bartholomew.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div style="background-color:black;color:green;margin:10px;padding:10px;font-size:10px;line-height:11px;"><code>MariaDB [test]> create table table1 (<br />
    -> a int not null,<br />
    -> b int as (a + 10) persistent);<br />
Query OK, 0 rows affected (0.28 sec)</p>
<p>MariaDB [test]> insert into table1 (a) values (1),(2),(3),(4);<br />
Query OK, 4 rows affected (0.12 sec)<br />
Records: 4  Duplicates: 0  Warnings: 0</p>
<p>MariaDB [test]> select * from table1;<br />
+---+------+<br />
| a | b &nbsp;&nbsp;&nbsp;|<br />
+---+------+<br />
| 1 |   11 &nbsp;&nbsp;|<br />
| 2 |   12 &nbsp;&nbsp;|<br />
| 3 |   13 &nbsp;&nbsp;|<br />
| 4 |   14 &nbsp;&nbsp;|<br />
+---+------+<br />
4 rows in set (0.00 sec)<br />
</code></div>
<p><em><strong>Tip:</strong></em> Don&#8217;t try to INSERT into a virtual column. MariaDB will just ignore you (and complain).</p>
<p>Now what happens if I do an alter table?</p>
<div style="background-color:black;color:green;margin:10px;padding:10px;font-size:10px;line-height:11px;"><code>MariaDB [test]> alter table table1<br />
    -> change b<br />
    -> b int as (a + 100) persistent;<br />
Query OK, 4 rows affected (0.41 sec)<br />
Records: 4  Duplicates: 0  Warnings: 0</p>
<p>MariaDB [test]> select * from table1;<br />
+---+------+<br />
| a | b &nbsp;&nbsp;&nbsp;|<br />
+---+------+<br />
| 1 | &nbsp;101 |<br />
| 2 | &nbsp;102 |<br />
| 3 | &nbsp;103 |<br />
| 4 | &nbsp;104 |<br />
+---+------+<br />
4 rows in set (0.00 sec)<br />
</code></div>
<p>As you can see, the values in the virtual column were automatically updated based on the new virtual column definition. Pretty cool, no?</p>
<p>The alternative to using virtual columns would be to use triggers, but if you change your trigger, the old generated values will not be updated automatically. Granted this may be the behavior you need, but then again, it might not be. If you would like the generated data to be automatically updated, use virtual columns; if not, use triggers. In my opinion, virtual columns are much easier to update and maintain compared to triggers, but maybe that&#8217;s just me.</p>
<p>For example, consider a table with (among other things) a price_usd column representing a price in USD (United States Dollars) and a price_eur column representing a price in EUR (Euros). For the purposes of this example, let&#8217;s pretend the price_eur column is either a persistent virtual column or is filled by a trigger automatically. If you are using the table to record sales, you probably don&#8217;t want old entries to be updated if they represent the exchange rate between EUR and USD on the day the entry was entered, the the trigger-filled version is probably what you want since it will record the price in USD and EUR when the sale was made. On the other hand, if the table is used to record current prices, you will want all of the generated columns to be updated if the exchange rate changes, so the virtual columns version is the one you want to use.</p>
<p>Anyway, virtual columns is one of the nifty new features in MariaDB 5.2. <a href="http://downloads.askmonty.org">Check it out!</a></p>
<p class="wp-flattr-button"></p> <p><a href="http://daniel-bartholomew.com/wordpress/?flattrss_redirect&amp;id=299&amp;md5=f9919438c24c04553496310ec7aedaf5" title="Flattr" target="_blank"><img src="http://daniel-bartholomew.com/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://daniel-bartholomew.com/wordpress/2010/09/road-to-mariadb-5-2-virtual-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AskMonty.org is moving</title>
		<link>http://daniel-bartholomew.com/wordpress/2010/02/askmonty-org-is-moving/</link>
		<comments>http://daniel-bartholomew.com/wordpress/2010/02/askmonty-org-is-moving/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 15:37:55 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Monty Program Ab]]></category>
		<category><![CDATA[MariaDB]]></category>

		<guid isPermaLink="false">http://daniel-bartholomew.com/wordpress/?p=246</guid>
		<description><![CDATA[As I write this, the theme song from The Jeffersons, "Movin' On Up", is running through my head. I don't remember all of the words, but the opening stanza goes something like this:
Movin' on up!
To the east side.
To a ...]]></description>
			<content:encoded><![CDATA[<p>As I write this, the theme song from <a title="The Jeffersons (Wikipedia Entry)" href="http://en.wikipedia.org/wiki/The_Jeffersons" target="_blank">The Jeffersons</a>, &#8220;Movin&#8217; On Up&#8221;, is running through my head. I don&#8217;t remember all of the words, but the opening stanza goes something like this:</p>
<p style="padding-left: 30px;">Movin&#8217; on up!<br />
To the east side.<br />
To a deluxe apartment<br />
in the sky.</p>
<p>It&#8217; s a bouncy, happy, gospel-flavored song. I always seem to think of it or hum it whenever I&#8217;m planning a move of some kind. The weird thing is, I never watched the show when it was on television. I saw the opening montage enough for it to stick with me, I guess.</p>
<p>So what&#8217;s moving over here? Well, the main server at Monty Program has been doing more than its fair share for a while, and it has done a decent job at it, but it&#8217;s time to give it a bit of a break, so we&#8217;re going to be moving some of its responsibilities to other servers over the coming weeks. The first service I&#8217;ve chosen to move is the <a title="AskMonty.org" href="http://askmonty.org" target="_blank">AskMonty.org</a> website. The move will happen on February 25th.</p>
<p>Thanks to the beauty of DNS, the move should be completely transparent to most users. There will be a brief period of read-only access while I copy the database from the old server to the new server, but that will only affect those that want to edit the <a title="AskMonty.org Wiki" href="http://askmonty.org/wiki/index.php/Main_Page" target="_blank">wiki</a>, or add things to <a title="AskMonty.org Worklog" href="http://askmonty.org/worklog" target="_blank">worklog</a>.</p>
<p>Of course, <a href="http://www.oscarsmovingcompany.com/10-worst-moving-company-disasters.html" target="_blank">anything</a> <a href="http://www.engadget.com/2009/12/23/rim-blames-massive-service-outage-on-new-messenger-version/" target="_blank">can</a> <a href="http://news.cnet.com/8301-13860_3-10372525-56.html" target="_blank">happen</a> during a move, so if you notice any weirdness on the site this Thursday, pop into<a title="IRC Help" href="http://askmonty.org/wiki/index.php/IRC" target="_blank"> #maria on freenode</a> and let me or one of the other ops know.</p>
<p>Thanks!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://daniel-bartholomew.com/wordpress/2010/02/askmonty-org-is-moving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Road to MariaDB 5.2: User Statistics</title>
		<link>http://daniel-bartholomew.com/wordpress/2010/02/the-road-to-mariadb-5-2-user-statistics/</link>
		<comments>http://daniel-bartholomew.com/wordpress/2010/02/the-road-to-mariadb-5-2-user-statistics/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 21:00:12 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Monty Program Ab]]></category>
		<category><![CDATA[MariaDB]]></category>

		<guid isPermaLink="false">http://daniel-bartholomew.com/wordpress/?p=244</guid>
		<description><![CDATA[One of the features I'm looking forward to using in MariaDB 5.2 is User Statistics. This feature allows me to easily gather various useful data about the tables and indexes in my database and about the users and clients ... <a href="http://daniel-bartholomew.com/wordpress/2010/02/the-road-to-mariadb-5-2-user-statistics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the features I&#8217;m looking forward to using in MariaDB 5.2 is <a title="User Statistics Manual Page" href="http://askmonty.org/wiki/index.php/Manual:Userstat">User Statistics</a>. This feature adds several new information schema tables and several new FLUSH and SHOW commands. These tables and commands can be used to understand MariaDB server activity better and to identify sources of my database&#8217;s load.</p>
<h2>Enabling Statistics</h2>
<p>Statistics gathering is turned off by default in MariaDB 5.2. This is done to prevent the extra load on a server that this feature causes from happening unless you want it.</p>
<p>To enable statistics gathering, just put the following line in the [mysqld] section of your my.cnf file (or use it on the command line when starting the server):</p>
<pre>userstat = 1</pre>
<p>Now start (or restart) your MariaDB 5.2 server and statistics will be gathered.</p>
<p><span style="color: #ff0000;"><strong>Warning:</strong></span> If you switch back and forth between MariaDB 5.1.xx and MariaDB 5.2 (like I do on my MariaDB testing box), and use the same my.cnf file, be aware that the &#8216;userstat = 1&#8243; line will not be recognized on versions of MariaDB prior to 5.2 and will cause errors.</p>
<h2>Showing and Flushing Statistics</h2>
<p>The User Statistics SHOW commands supported by MariaDB 5.2 are:</p>
<pre>SHOW CLIENT_STATISTICS
SHOW USER_STATISTICS
SHOW INDEX_STATISTICS
SHOW TABLE_STATISTICS</pre>
<p>If you want to restart the counters on any of these (like after you roll out a change to your application) you will find the following FLUSH commands handy:</p>
<pre>FLUSH CLIENT_STATISTICS
FLUSH USER_STATISTICS
FLUSH INDEX_STATISTICS
FLUSH TABLE_STATISTICS
</pre>
<h2>Information Schemas</h2>
<p>The above SHOW and FLUSH commands are just easy ways to view and flush the actual statistics, which are stored in the information_schema database. Specifically, statistics are stored in the following tables in the information_schema database:</p>
<pre>CLIENT_STATISTICS
USER_STATISTICS
INDEX_STATISTICS
TABLE_STATISTICS
</pre>
<p>The CLIENT_STATISTICS table stores information such as the number of concurrent connections from a particular client, the number of rows read by a particular client, the number of SELECT or UPDATE commands executed by a particular client and so on.</p>
<p>The USER_STATISTICS table stores the same information as the CLIENT_STATISTICS table, but on a per user basis.</p>
<p>The INDEX_STATISTICS table stores statistics on index usage and makes it possible to do things like locating unused indexes and generating the commands to remove them.</p>
<p>The TABLE_STATISTICS table is similar to the INDEX_STATISTICS table, but contains statistics on table usage such as the number of rows read and changed in a particular table.</p>
<h2>More Information</h2>
<p>Detailed information about User Statistics in MariaDB (including schemas for the various tables) is available on the askmonty.org website: <a title="User Statistics Manual Page" href="http://askmonty.org/wiki/index.php/Manual:Userstat">http://askmonty.org/wiki/index.php/Manual:Userstat</a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://daniel-bartholomew.com/wordpress/2010/02/the-road-to-mariadb-5-2-user-statistics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dog food</title>
		<link>http://daniel-bartholomew.com/wordpress/2009/12/dog_food/</link>
		<comments>http://daniel-bartholomew.com/wordpress/2009/12/dog_food/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 17:04:13 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monty Program Ab]]></category>
		<category><![CDATA[MariaDB]]></category>

		<guid isPermaLink="false">http://daniel-bartholomew.com/wordpress/?p=239</guid>
		<description><![CDATA[There's a saying in certain circles about "being willing to eat your own dog food". It's a reference a company who produces products that the company doesn't or the employees of the company don't use. Some (hypothetical) examples would be: ...]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a saying in certain circles about &#8220;being willing to eat your own dog food&#8221;. It&#8217;s a reference a company who produces products that the company doesn&#8217;t or the employees of the company don&#8217;t use. Some (hypothetical) examples would be: executives at GM driving around in Fords or Apple employees using Dell laptops.</p>
<p>At Monty Program we&#8217;ve been guilty of this. Up until a few days ago our main website, <a title="askmonty.org" href="http://askmonty.org">askmonty.org</a>, was running the stock MySQL server from our chosen Linux distribution&#8217;s repositories. This was mainly done for system administration simplicity. However, MariaDB now has Debian, Ubuntu, and CentOS packages <a href="http://askmonty.org/downloads">available for download</a> and we saw no reason to not eat our own dog food. Yes, we could have taken the time to create custom build of MariaDB just for our own use even before our first beta releases, but like the barber with the bad haircut and the cobbler&#8217;s children with no shoes we are too busy improving MariaDB to focus on geeking up our web server with custom builds. For our production servers we would rather use standard packages like nearly everyone else on the planet. Why? So that we can focus on doing what we do best: making MariaDB the best version of MySQL you&#8217;ll find anywhere.</p>
<p>So how did the upgrade go? Swimmingly. There were a couple glitches due to some historical weirdness on our web server, but once those minor issues were resolved the install of the beta MariaDB packages was trouble-free. It just worked. All of the MySQL databases on the server were in perfect working order after the upgrade with the exception of a single table in one of the databases which was easily fixed with a &#8220;REPAIR TABLE dbname.tablename;&#8221;.</p>
<p>Oh, and before you ask: I performed a full backup of all of our databases to an external drive prior to doing the upgrade. I trust MariaDB as much as anyone can, but power outages, lightning strikes, earthquakes, floods, and even meteors hit Finland at the exact wrong time every once in a while and it would be just my luck to have one of those happen during an upgrade.</p>
<p>In conclusion: Monty Program is now eating its own dog food, and it&#8217;s awesome. <img src='http://daniel-bartholomew.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://daniel-bartholomew.com/wordpress/2009/12/dog_food/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Big Changes Ahead</title>
		<link>http://daniel-bartholomew.com/wordpress/2009/05/big-changes-ahead/</link>
		<comments>http://daniel-bartholomew.com/wordpress/2009/05/big-changes-ahead/#comments</comments>
		<pubDate>Wed, 13 May 2009 23:18:53 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Monty Program Ab]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://daniel-bartholomew.com/wordpress/?p=136</guid>
		<description><![CDATA[Big changes are afoot in the Bartholomew household. <a href="http://daniel-bartholomew.com/wordpress/2009/05/big-changes-ahead/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Big changes are afoot in the Bartholomew household.</p>
<p>29 May 2009 will be my last day at my current employer. <a title="Global Knowledge" href="http://www.globalknowledge.com" target="_blank">Global Knowledge</a> has been good to me these past four years. I&#8217;ll miss working with the people in my group. It is a very Linux and Open Source friendly group and I&#8217;ve learned a lot while I&#8217;ve been here.</p>
<p>So, where will I be going? Funny you should ask&#8230; <img src='http://daniel-bartholomew.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>For those of you familiar with databases, Michael (Monty) Widenius is the founder and original developer of the MySQL database. The database is named after his daughter, My. In 2008 he sold the database and the MySQL company he co-founded to Sun Microsystems. After being at Sun for a few months he <a title="Time to move on" href="http://monty-says.blogspot.com/2009/02/time-to-move-on.html" target="_blank">decided to leave</a>. The MySQL database is Open Source software, so he was able to create a branch of MySQL called <a title="MariaDB FAQ" href="http://askmonty.org/wiki/index.php/MariaDB" target="_blank">MariaDB</a> (Maria is Monty&#8217;s other daughter).</p>
<p>Starting on 1 June 2009 I will start working as a technical writer and sys-admin for <a title="askmonty.org" href="http://askmonty.org" target="_blank">Monty Program Ab</a>, the company Monty set up to develop and support MariaDB.</p>
<p>I&#8217;m very excited for this new opportunity and while it will bring lots of changes one thing that won&#8217;t be changing is our address. We&#8217;re staying right where we are.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://daniel-bartholomew.com/wordpress/2009/05/big-changes-ahead/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

