<?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>PlanetMysql.ru - информация о СУБД MySQL &#187; 5.1</title>
	<atom:link href="http://planetmysql.ru/category/5-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetmysql.ru</link>
	<description>Блог о самой популярной СУБД MySQL</description>
	<lastBuildDate>Thu, 29 Jul 2010 23:40:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Webinar:  What you need to know for a MySQL 5.0 -&gt; 5.1 upgrade</title>
		<link>http://www.pythian.com/news/15027/webinar-what-you-need-to-know-for-a-mysql-5-0-5-1-upgrade/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=webinar-what-you-need-to-know-for-a-mysql-5-0-5-1-upgrade</link>
		<comments>http://www.pythian.com/news/15027/webinar-what-you-need-to-know-for-a-mysql-5-0-5-1-upgrade/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:02:09 +0000</pubDate>
		<dc:creator>Sheeri K. Cabral</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[Pythian Appearances]]></category>
		<category><![CDATA[Technical Blog]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.pythian.com/news/?p=15027</guid>
		<description><![CDATA[IOUG has a free series of three webinars on upgrading MySQL.  Each webinar is an hour long, and it starts with a webinar by me tomorrow at 12 noon Central time (GMT-5) on &#8220;Why and How to Upgrade to MySQL 5.1&#8243;.  The webinar assumes you are upgrading from MySQL 5.0 to MySQL 5.1, and talks a little bit about the new features, server variables, and what you need to know when upgrading to MySQL 5.1.
The software used is GoToWebinar (formerly GoToMeeting), so you will need to install that software.  To register, use the links on the IOUG MySQL Upgrade Webinar Series page.
The complete list of webinars in the MySQL Upgrade Series is:
    *  MySQL 5.1: Why and How to Upgrade
      Sheeri Cabral, The Pythian Group
      Tuesday, July 27, 12:00 p.m. – 1:00 p.m. CT (GMT-5)
    * MySQL Upgrades With No Downtime
      Sean Hull, Heavyweight Internet Group
      Wednesday, July 28, 12:00 p.m. – 1:00 p.m. CT (GMT-5)
    * MySQL Upgrade Best Practices
      Matt Yonkovit, Percona
      Thursday, July 29, 12:00 p.m. – 1:00 p.m. CT (GMT-5)
(note, I am not sure if it is free for everyone or just free for IOUG members; my apologies if it is the latter)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ioug.org/">IOUG</a> has a <strong>free</strong> <a href="http://www.ioug.org/Events/OnlineEducationSeries/tabid/85/Default.aspx">series of three webinars on upgrading MySQL</a>.  Each webinar is an hour long, and it starts with a webinar by me <strong>tomorrow</strong> at 12 noon Central time (GMT-5) on &#8220;Why and How to Upgrade to MySQL 5.1&#8243;.  The webinar assumes you are upgrading from MySQL 5.0 to MySQL 5.1, and talks a little bit about the new features, server variables, and what you need to know when upgrading to MySQL 5.1.</p>
<p>The software used is GoToWebinar (formerly GoToMeeting), so you will need to install that software.  To register, use the links on the <a href="http://www.ioug.org/Events/OnlineEducationSeries/tabid/85/Default.aspx">IOUG MySQL Upgrade Webinar Series</a> page.</p>
<p>The complete list of webinars in the MySQL Upgrade Series is:<br />
    *  MySQL 5.1: Why and How to Upgrade<br />
      Sheeri Cabral, The Pythian Group<br />
      Tuesday, July 27, 12:00 p.m. – 1:00 p.m. CT (GMT-5)</p>
<p>    * MySQL Upgrades With No Downtime<br />
      Sean Hull, Heavyweight Internet Group<br />
      Wednesday, July 28, 12:00 p.m. – 1:00 p.m. CT (GMT-5)</p>
<p>    * MySQL Upgrade Best Practices<br />
      Matt Yonkovit, Percona<br />
      Thursday, July 29, 12:00 p.m. – 1:00 p.m. CT (GMT-5)</p>
<p>(note, I am not sure if it is free for everyone or just free for IOUG members; my apologies if it is the latter)</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25399&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=25399&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://www.pythian.com/news/15027/webinar-what-you-need-to-know-for-a-mysql-5-0-5-1-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Initial thoughts on space compression using the innodb_plugin</title>
		<link>http://blog.wl0.org/2010/05/initial-thoughts-on-space-compression-using-the-innodb_plugin/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=initial-thoughts-on-space-compression-using-the-innodb_plugin</link>
		<comments>http://blog.wl0.org/2010/05/initial-thoughts-on-space-compression-using-the-innodb_plugin/#comments</comments>
		<pubDate>Sun, 23 May 2010 07:47:11 +0000</pubDate>
		<dc:creator>Simon Mudd</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[antelope]]></category>
		<category><![CDATA[barracuda]]></category>
		<category><![CDATA[compressed]]></category>
		<category><![CDATA[innodb_plugin]]></category>
		<category><![CDATA[merlin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[space compression]]></category>

		<guid isPermaLink="false">http://blog.wl0.org/?p=261</guid>
		<description><![CDATA[While setting up MySQL Enterprise Monitor 2.2 (Merlin) on a system which had been running version 2.1 I thought I&#8217;d try and see what difference the change from using normal innodb tables to using the compressed table format available in the innodb plugin.
I&#8217;ve been using a separate db backend for merlin because for me it&#8217;s easier to manage and also the database backend has been put on a dedicated server. I&#8217;ve also been trying the innodb_plugin on another busier server as I had performance problems with the normal 5.1.42 built-in innodb engine which the plugin managed to solve.
So given that I was using a separate db server I upgraded it to 5.1.47, configured the server to use the plugin (1.0.8) rather than to use the built-in innodb engine and then decided to alter the data tables (dc_p_long, dc_p_string and dc_p_double) to use the new innodb compressed table format. These tables are designed for storing a large number of rows of a specific type but there was no harm in trying.
Here are the results by doing the following:
SET GLOBAL innodb_file_format = "Barracuda";
ALTER TABLE dc_p_xxxx ROW_FORMAT=compressed;

Using the older Antelope storage format:
dc_p_string 178 MB
dc_p_double 514 MB
dc_p_long 15.3 GB
Using Barracuda COMPRESSED:
dc_p_string 35 MB
dc_p_double 223 MB
dc_p_long  6.8 GB
The compressed format is using the standard block size. I need to do further tests to see how much difference using the smaller 1 kb, 2 kb or 4 kb blocks will make.
So from the point of view of Merlin only it does seem to make sense to use this format, assuming performance is not significantly affected. After all it means I can store twice the amount of data on disk, and one of the problems I have had in the past is that I could only keep a week&#8217;s worth of data because of storage limitations. Note: the 2.1 to 2.2 update will save a lot of space as the string table will drop in size significantly. However gaining an extra 50% by using innodb compression seems worth doing if it comes for free.
That said I have been told that there are still a few issues with this new table format so for anyone looking to use it in production it may be best to wait for 5.1.48 which should remove a few of these edge cases.  If you only want to see how much difference the storage usage is then 5.1.47 should be ok. YMMV.
In the meantime I&#8217;m going to leave this server running for a while. Merlin does hammer the db quite heavily, so I&#8217;ll be able to see if it survives in a few days.
I also have a few servers which currently use MyISAM tables because of the smaller disk footprint compared to innodb. These servers do suffer from some of MyISAM&#8217;s weaknesses such as concurrent reading and writing on the same table is not possible, so now it looks like we might have a good reason to try this compressed table format out and with that gain a lot using innodb. Recovery after a crash has always been a problem on this type of server and innodb recovery should be both quicker and less intrusive.
I&#8217;m looking forward to further experimentation but so far this new compressed format does look promising. So thanks to the innodb folk who have made this possible.]]></description>
			<content:encoded><![CDATA[<p>While setting up <a title="MySQL Enterprise Monitor" href="http://www.mysql.com/products/enterprise/monitor.html" >MySQL Enterprise Monitor 2.2</a> (Merlin) on a system which had been running version 2.1 I thought I&#8217;d try and see what difference the change from using normal innodb tables to using the compressed table format available in the <a title="Innodb plugin" href="http://www.innodb.com/products/innodb_plugin/" >innodb plugin</a>.</p>
<p>I&#8217;ve been using a separate db backend for merlin because for me it&#8217;s easier to manage and also the database backend has been put on a dedicated server. I&#8217;ve also been trying the innodb_plugin on another busier server as I had performance problems with the normal 5.1.42 built-in innodb engine which the plugin managed to solve.</p>
<p>So given that I was using a separate db server I upgraded it to 5.1.47, configured the server to use the plugin (1.0.8) rather than to use the built-in innodb engine and then decided to alter the <em>data tables</em> (dc_p_long, dc_p_string and dc_p_double) to use the new innodb compressed table format. These tables are designed for storing a large number of rows of a specific type but there was no harm in trying.</p>
<p>Here are the results by doing the following:</p>
<p><code>SET GLOBAL innodb_file_format = "Barracuda";<br />
ALTER TABLE dc_p_xxxx ROW_FORMAT=compressed;<br />
</code></p>
<p>Using the older <em>Antelope</em> storage format:</p>
<p>dc_p_string 178 MB<br />
dc_p_double 514 MB<br />
dc_p_long 15.3 GB</p>
<p>Using <em>Barracuda</em> COMPRESSED:<br />
dc_p_string 35 MB<br />
dc_p_double 223 MB<br />
dc_p_long  6.8 GB</p>
<p>The compressed format is using the <em>standard</em> block size. I need to do further tests to see how much difference using the smaller 1 kb, 2 kb or 4 kb blocks will make.</p>
<p>So from the point of view of Merlin only it does seem to make sense to use this format, assuming performance is not significantly affected. After all it means I can store twice the amount of data on disk, and one of the problems I have had in the past is that I could only keep a week&#8217;s worth of data because of storage limitations. Note: the 2.1 to 2.2 update will save a lot of space as the string table will drop in size significantly. However gaining an extra 50% by using innodb compression seems worth doing if it comes for free.</p>
<p>That said I have been told that there are still a few issues with this new table format so for anyone looking to use it in production it may be best to wait for 5.1.48 which should remove a few of these edge cases.  If you only want to see how much difference the storage usage is then 5.1.47 should be ok. YMMV.</p>
<p>In the meantime I&#8217;m going to leave this server running for a while. Merlin does hammer the db quite heavily, so I&#8217;ll be able to see if it survives in a few days.</p>
<p>I also have a few servers which currently use MyISAM tables because of the smaller disk footprint compared to innodb. These servers do suffer from some of MyISAM&#8217;s weaknesses such as concurrent reading and writing on the same table is not possible, so now it looks like we might have a good reason to try this compressed table format out and with that gain a lot using innodb. Recovery after a crash has always been a problem on this type of server and innodb recovery should be both quicker and less intrusive.</p>
<p>I&#8217;m looking forward to further experimentation but so far this new compressed format does look promising. So thanks to the innodb folk who have made this possible.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24836&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24836&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://blog.wl0.org/2010/05/initial-thoughts-on-space-compression-using-the-innodb_plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 5.1.47 and 5.0.91 released &#8211; Two strong reasons to upgrade</title>
		<link>http://blogs.sun.com/datacharmer/entry/mysql_5_1_47_released?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mysql-5-1-47-and-5-0-91-released-two-strong-reasons-to-upgrade</link>
		<comments>http://blogs.sun.com/datacharmer/entry/mysql_5_1_47_released#comments</comments>
		<pubDate>Fri, 21 May 2010 04:38:48 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.0]]></category>
		<category><![CDATA[5.1]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[plugin.innodb]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/datacharmer/entry/mysql_5_1_47_released</guid>
		<description><![CDATA[




MySQL has released security updates for MySQL 5.1.47 and 5.0.91. The most important changes in these releases are fixes of three security bugs. One of them is a problem that had been lurking in the code for many years, and it was found by chance when one of our developers, testing something unrelated, stumbled upon one of the vulnerabilities. Later on, when analyzing the bug, the developers found one more issue, and they fixed it as well. 

MySQL 5.1.47
In addition to the security update, MySQL 5.1.47 is also very important for an additional reason. The InnoDB plugin that ships with this version has been updated to 1.0.8, which is considered to be of General Availability (GA) quality.

There are more changes, including some twists to the error log, to make replication administration more robust.

MySQL 5.0.91 security update

Together with MySQl 5.1.47, there is a security update of MySQL 5.0.91.
Since MySQL 5.0 is now in Extended Support state, the binaries are not in the main download pages, but only in the archives.
 As the MySQL Lifecycle Policy says, only serious security bugs are fixed, and the binaries are provided at the company's discretion. 

If you are still using MySQL 5.0, this is a good moment to upgrade to 5.1.]]></description>
			<content:encoded><![CDATA[<table border="0">
<tr><td>
<a href="http://dev.mysql.com/doc/refman/5.1/en/news-5-1-47.html"><img src="http://blogs.sun.com/datacharmer/resource/sakila_security_256x203.jpg" border="0" title="MySQL Security alert" alt="MySQL security" /></a>
</td>
<td>
MySQL has released security updates for MySQL 5.1.47 and 5.0.91. The most important changes in these releases are fixes of three security bugs. One of them is a problem that had been lurking in the code for many years, and it was found by chance when one of our developers, testing something unrelated, stumbled upon one of the vulnerabilities. Later on, when analyzing the bug, the developers found one more issue, and they fixed it as well. 
</td></tr></table>
<h3>MySQL 5.1.47</h3>
<p>In addition to the security update, MySQL 5.1.47 is also very important for an additional reason. The <a href="http://dev.mysql.com/doc/innodb-plugin/1.0/en/innodb-plugin-introduction.html">InnoDB plugin</a> that ships with this version has been updated to 1.0.8, which is considered to be of General Availability (GA) quality.
</p>
<p>There are more <a href="http://dev.mysql.com/doc/refman/5.1/en/news-5-1-47.html">changes</a>, including some twists to the error log, to make replication administration more robust.
</p>
<h3>MySQL 5.0.91 security update</h3>
<p>
Together with MySQl 5.1.47, there is a security update of <a href="http://dev.mysql.com/doc/refman/5.0/en/news-5-0-91.html">MySQL 5.0.91</a>.<p>
<p>Since MySQL 5.0 is now in <a href="http://www.mysql.com/about/legal/lifecycle/">Extended Support</a> state, the binaries are not in the main download pages, but only in the <a href="http://downloads.mysql.com/archives.php?p=mysql-5.0">archives</a>.
 As the <a href="http://www.mysql.com/about/legal/lifecycle/">MySQL Lifecycle Policy</a> says, only serious security bugs are fixed, and the binaries are provided at the company's discretion. 
</p>
<p>If you are still using MySQL 5.0, this is a good moment to upgrade to 5.1.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24825&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24825&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://blogs.sun.com/datacharmer/entry/mysql_5_1_47_released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two quick performance tips with MySQL 5.1 partitions</title>
		<link>http://datacharmer.blogspot.com/2010/05/two-quick-performance-tips-with-mysql.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=two-quick-performance-tips-with-mysql-5-1-partitions</link>
		<comments>http://datacharmer.blogspot.com/2010/05/two-quick-performance-tips-with-mysql.html#comments</comments>
		<pubDate>Thu, 06 May 2010 09:20:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[partitioning]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-16959946.post-3808783844661595298</guid>
		<description><![CDATA[While I was researching for my partitions tutorial, I came across two hidden problems, which may happen often, but are somehow difficult to detect and even more difficult to fix, unless you know what's going on, and why. I presented both cases during my tutorial, but there were no pictures to convey the mechanics of the problem. Here is the full story.TO_DAYS() prunes two partitions instead of oneIf you are partitioning by date, chances are that you are using TO_DAYS(). And depending on how you have partitioned your table, your queries are as fast as you expect them to be. However, there are cases where your query takes twice as long as it should, and of course this will not make you happy.For example, in a table partitioned by month, when your query searches for values within one specific month, EXPLAIN PARTITIONS tells you that the search involves two partitions (see figure above). This means that, instead of searching through 1,000,000 rows in one partitions, the partitions engine is searching through 2,000,000 rows in two partitions.But why? The reasoning, as reported from the developers, is that This is not a bug, since TO_DAYS() returns NULL for invalid dates, it needs to scan the first partition as well (since that holds all NULL values) for ranges.Bug#49754: Partitioning by RANGE with TO_DAYS always includes first partition when pruningThis makes sense, from a developer's standpoint. From a user's experience, though, it's a bug.Anyway, it doesn't do us any good to rant about it. Our query is still twice as slow as we want it. We need to take action. The workaround is to create an empty partition in first position. If we are creating a new table, it's simple. Just say PARTITION p000 VALUES LESS THAN (0) and all will be well. The partition pruning mechanism will still find two partitions, but since the first one is empty, it won't impact the performance. If you have an existing table already partitioned, like in our example, then you need to perform a different operationNow we have a different first partition, with no records. When we issue the same query, the partition pruning will look at partition p0, but it will skip it because there are no records.Inserting single rows in partitions is slowAlso this bug is sometimes difficult to detect. If you want to test partitions in MySQL 5.1, probably you will take an existing table and convert it to a partitioned one, or you create a new table and load the contents from a dump. Either way, you are unlikely to insert millions of records with single INSERT statements. These single inserts are slower than bulk inserts in the first place, but with partitions there is an additional penalty. Whenever you insert a record, the partitioning engine locks the entire table. When you insert thousands of records, the partitioning engine will lock all partitions before the insert, and unlock them after the insert. If you have 500 partitions, that's 500 locks and 500 unlocks for every statement. Ouch! It's a design problem, and it is not likely to be fixed without turning around the whole architecture of partitions. Also in this case, there is a bug report, Partitioning performance drops drastically with hundreds of partitions, although nobody says that this is a feature.What can you do, then? You have several choices:You can use a bulk insert. Instead of single statements, use INSERT with multiple records, or LOAD DATA INFILE.Explicitly LOCK the table before inserting and UNLOCK it after you finish with all the inserts. This will avoid the overhead, although it won't make your table concurrently accessible until you finish.If you use partitioning only to facilitate heavy queries, consider using a non-partitioned table on the master, and partitioned  ARCHIVE tables on the slaves (see figure below).  As I have said many times in my presentations, always benchmark before using partitions in production. Whether you think that it will boost your performance or that it will slow things down, don't trust your instincts, and test. You may be up for a surprise.]]></description>
			<content:encoded><![CDATA[<table border="0"><tr><td><a href="http://datacharmer.blogspot.com/"><img src="http://lh5.ggpht.com/_gVfZHGgf5LA/S95nd5lfemI/AAAAAAAAA3s/P-n0eh81rG8/partitions.png" alt="partitions" title="MySQL partitions" width="200" border="0" /></a></td><td>While I was researching for my partitions tutorial, I came across two hidden problems, which may happen often, but are somehow difficult to detect and even more difficult to fix, unless you know what's going on, and why. I presented both cases during my tutorial, but there were no pictures to convey the mechanics of the problem. Here is the full story.<br /></td></tr></table><h3>TO_DAYS() prunes two partitions instead of one</h3><br />If you are partitioning by date, chances are that you are using <code>TO_DAYS()</code>. And depending on how you have partitioned your table, your queries are as fast as you expect them to be. However, there are cases where your query takes twice as long as it should, and of course this will not make you happy.<br /><img src="http://lh3.ggpht.com/_gVfZHGgf5LA/S-KAg5VRbaI/AAAAAAAAA3w/YfNPUraukQI/partitions_to_days1.png" width="500" /><br />For example, in a table partitioned by month, when your query searches for values within one specific month, <code>EXPLAIN PARTITIONS</code> tells you that the search involves two partitions (see figure above). This means that, instead of searching through 1,000,000 rows in one partitions, the partitions engine is searching through 2,000,000 rows in two partitions.<br />But why? The reasoning, as reported from the developers, is that <blockquote><i>This is not a bug, since TO_DAYS() returns NULL for invalid dates, it needs to scan the first partition as well (since that holds all NULL values) for ranges.</i></blockquote><br /><a href="http://bugs.mysql.com/bug.php?id=49754">Bug#49754: Partitioning by RANGE with TO_DAYS always includes first partition when pruning</a><br />This makes sense, from a developer's standpoint. From a user's experience, though, <a href="http://datacharmer.blogspot.com/2007/01/what-is-bug.html">it's a bug</a>.<br />Anyway, it doesn't do us any good to rant about it. Our query is still twice as slow as we want it. We need to take action. The workaround is to create an empty partition in first position. If we are creating a new table, it's simple. Just say <pre><code>PARTITION p000 VALUES LESS THAN (0)</code></pre> and all will be well. The partition pruning mechanism will still find two partitions, but since the first one is empty, it won't impact the performance. <br />If you have an existing table already partitioned, like in our example, then you need to perform a different operation<br /><img src="http://lh4.ggpht.com/_gVfZHGgf5LA/S-KAhLC9_qI/AAAAAAAAA30/kZl4R7EnUPo/partitions_to_days2.png" width="500" /><br />Now we have a different first partition, with no records. When we issue the same query, the partition pruning will look at partition p0, but it will skip it because there are no records.<br /><img src="http://lh4.ggpht.com/_gVfZHGgf5LA/S-KAhL-5KFI/AAAAAAAAA34/91eJPrH2CxE/partitions_to_days3.png" width="500" /><br /><h3>Inserting single rows in partitions is slow</h3><br />Also this bug is sometimes difficult to detect. If you want to test partitions in MySQL 5.1, probably you will take an existing table and convert it to a partitioned one, or you create a new table and load the contents from a dump. Either way, you are unlikely to insert millions of records with single INSERT statements. These single inserts are slower than bulk inserts in the first place, but with partitions there is an additional penalty. Whenever you insert a record, the partitioning engine <b>locks the entire table</b>. When you insert thousands of records, the partitioning engine will lock all partitions before the insert, and unlock them after the insert. If you have 500 partitions, that's 500 locks and 500 unlocks for every statement. Ouch! <br />It's a design problem, and it is not likely to be fixed without turning around the whole architecture of partitions. Also in this case, there is a bug report, <a href="http://bugs.mysql.com/bug.php?id=37252">Partitioning performance drops drastically with hundreds of partitions</a>, although nobody says that this is a feature.<br />What can you do, then? You have several choices:<br /><ul><li>You can use a bulk insert. Instead of single statements, use INSERT with multiple records, or LOAD DATA INFILE.</li><li>Explicitly LOCK the table before inserting and UNLOCK it after you finish with all the inserts. This will avoid the overhead, although it won't make your table concurrently accessible until you finish.</li><li>If you use partitioning only to facilitate heavy queries, consider using a non-partitioned table on the master, and partitioned  ARCHIVE tables on the slaves (see figure below).  </li></ul><br /><img src="http://lh6.ggpht.com/_gVfZHGgf5LA/S-KG9KVvF-I/AAAAAAAAA38/8OTrzRkx2Jo/s640/partitions_replication_scheme.png" width="500" /><br />As I have said many times in my presentations, always benchmark before using partitions in production. Whether you think that it will boost your performance or that it will slow things down, don't trust your instincts, and test. You may be up for a surprise.<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-3808783844661595298?l=datacharmer.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24666&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=24666&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://datacharmer.blogspot.com/2010/05/two-quick-performance-tips-with-mysql.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Further Thoughts on MySQL Upgrades</title>
		<link>http://blog.wl0.org/2010/01/further-thoughts-on-mysql-upgrades/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=further-thoughts-on-mysql-upgrades</link>
		<comments>http://blog.wl0.org/2010/01/further-thoughts-on-mysql-upgrades/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 23:25:48 +0000</pubDate>
		<dc:creator>Simon Mudd</dc:creator>
				<category><![CDATA[5.0]]></category>
		<category><![CDATA[5.1]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://blog.wl0.org/2010/01/further-thoughts-on-mysql-upgrades/</guid>
		<description><![CDATA[I have been upgrading more MySQL database instances recently and have found a few more potential gotchas, which if you are not careful, can potentially be rather nasty. These are not documented explicitly by MySQL, so it may be handy for you to know if you have not come across this type of thing before.
Most of the issues are those related to upgrading MySQL instances which are replicated, either the master servers or the slaves. Some seem specific to the rpm packages I am using (MySQL enterprise or MySQL advanced rpms), though others are not.
Take care upgrading a 5.0 master when you have 5.1 slaves
It is not a good idea to run a mixed major version of mysql in a replicated environment so why would I be doing this? If you work in a replicated environment and have several slaves then it is recommended that you upgrade the slaves first. I work with quite a few slaves so the process of upgrading them all takes longer than you would think. Quite a long time in fact, while different systems are tested and upgraded. Along came a newer version of 5.0 and I thought of upgrading the master which had been giving a few issues, and one of them was resolved in the lastest 5.0.89. At least when using rpm packages, the package upgrade uses /usr/bin/mysql_install_db &#8211;rpm &#8211;user=mysql as part of the package upgrade procedure. This ensures that the mysql db is up to date but also writes to the binlog if one is configured. running on a master normally this would be the case. Of course these are 5.0 install commands and they are not really understood by the slaves which try to interpret them too. End result. Broken replication and you need to skip several transactions. If you have several slaves this can be rather painful.
Note: this is the cause of replicating the mysql database which I do as it is a good, quick and clean way to distribute GRANT information on to all slaves. As far as I know MySQL does not discourage this though perhaps many sites do not replicate their MySQL database.
If you upgrade a master server from 5.o to 5.1 by running mysql_upgrade after upgrading the binaries you may have a similar issue as the mysql_upgrade script determines that some new columns or tables are needed on the master and so adds them.  Again this gets written to the binlog which is good for point in time recovery on the server itself, but again bad from a replication point of view if the slave does not run the same version of MySQL.
In fact the binlog has these 2 uses: (a) writing changes for point in time recovery, and (b) writing the changes for replication to slaves.  Once could argue that for (a) the changes should not be written to the binlog but I think that is wrong if you have to recover just after an upgrade. So I would suggest that the upgrade changes should probably flagged specially in the binlog, allowing the slave to probably ignore them in the normal situation but also be able to recognise them, allowing you to stop the slave and perform the same binary upgrade, and then continue the upgrade with the new binaries exactly in the way this had been executed on the master. This behaviour should be controlled by a runtime flag which can be dynamically configured.
RPM Installs/Upgrades always start the server
rpm(8) is good but some of the design decisions in the MySQL rpms are questionable. One of these is that the current MySQL rpms are designed to always start when either doing a fresh install or doing an upgrade. Currently it&#8217;s not good practice to do rpm -Uvh MySQL-server-advanced-gpl&#8230;rpm (5.1 rpm) if you are running a MySQL-server-enterprise-gpl&#8230;rpm (5.0 rpm) so normally I stop MySQL, remove the enterprise rpm and install the advanced rpm. That starts the server and the slave on a box which is not completely &#8220;stable&#8221;. Solution is to add slave-skip-start to /etc/my.cnf but that should not be necessary as immediately after running mysql_upgrade you need to remove the value again.
Also during the upgrade process it is a good thing to avoid external client access so sometimes I also set the bind-address to 127.0.0.1 during the period of the upgrade.  That may not keep clients away if they are running on the local server but helps in many cases.
Conclusions
All this leads me to a simple conclusion: if you can, upgrade one box the slow way and then clone the other slaves from that. Cloning is simple and requires no thought so is a good idea.
The other conclusion based on the first one is that if you can: build a new master. That is clone a slave to make a new master. This will be the new master. Configure it to write it&#8217;s own binlogs and then you can move the existing slaves underneath the new one. Once all slaves are underneath the new master (left as the only slave of the original master) then you can simply point clients to the new master instead of the old one. That keeps down time to a minimum and avoids many problems.
As far as I know none of the comments I have made above are in the current 5.1 upgrade documentation. I have opened quite a few tickets requesting the documentation be improved and I guess that will happen slowly. For many people the points I have mentioned may seem irrelevant for their situation but for me they have caused a few problems. If you do not need to worry, then you can skip the documentation, otherwise if this were documented then you would be saved a few tears when least expecting problems.]]></description>
			<content:encoded><![CDATA[<p>I have been upgrading more MySQL database instances recently and have found a few more potential <em>gotchas,</em> which if you are not careful, can potentially be rather nasty. These are not documented explicitly by MySQL, so it may be handy for you to know if you have not come across this type of thing before.</p>
<p>Most of the issues are those related to upgrading MySQL instances which are replicated, either the master servers or the slaves. Some seem specific to the rpm packages I am using (MySQL enterprise or MySQL advanced rpms), though others are not.</p>
<h2>Take care upgrading a 5.0 master when you have 5.1 slaves</h2>
<p>It is not a good idea to run a mixed major version of mysql in a replicated environment so why would I be doing this? If you work in a replicated environment and have several slaves then it is recommended that you upgrade the slaves first. I work with quite a few slaves so the process of upgrading them all takes longer than you would think. Quite a long time in fact, while different systems are tested and upgraded. Along came a newer version of 5.0 and I thought of upgrading the master which had been giving a few issues, and one of them was resolved in the lastest 5.0.89. At least <span>when using rpm packages</span>, the package upgrade uses /usr/bin/mysql_install_db &#8211;rpm &#8211;user=mysql as part of the package upgrade procedure. This ensures that the mysql db is up to date but also writes to the binlog if one is configured. running on a master normally this would be the case. Of course these are 5.0 install commands and they are not really understood by the slaves which try to interpret them too. End result. Broken replication and you need to skip several transactions. If you have several slaves this can be rather painful.</p>
<p>Note: this is the cause of replicating the <span>mysql</span> database which I do as it is a good, quick and clean way to distribute GRANT information on to all slaves. As far as I know MySQL does not discourage this though perhaps many sites do not replicate their MySQL database.</p>
<p>If you upgrade a master server from 5.o to 5.1 by running <em>mysql_upgrade</em> after upgrading the binaries you may have a similar issue as the <em>mysql_upgrade</em> script determines that some new columns or tables are needed on the master and so adds them.  Again this gets written to the binlog which is good for point in time recovery on the server itself, but again bad from a replication point of view if the slave does not run the same version of MySQL.</p>
<p>In fact the binlog has these 2 uses: (a) writing changes for point in time recovery, and (b) writing the changes for replication to slaves.  Once could argue that for (a) the changes should not be written to the binlog but I think that is wrong if you have to recover just after an upgrade. So I would suggest that the <em>upgrade changes</em> should probably flagged specially in the binlog, allowing the slave to probably ignore them in the normal situation but also be able to recognise them, allowing you to stop the slave and perform the same binary upgrade, and then continue the upgrade with the new binaries exactly in the way this had been executed on the master. This behaviour should be controlled by a runtime flag which can be dynamically configured.</p>
<h2>RPM Installs/Upgrades always start the server</h2>
<p>rpm(8) is good but some of the design decisions in the MySQL rpms are questionable. One of these is that the current MySQL rpms are designed to always start when either doing a fresh install or doing an upgrade. Currently it&#8217;s not good practice to do rpm -Uvh MySQL-server-advanced-gpl&#8230;rpm (5.1 rpm) if you are running a MySQL-server-enterprise-gpl&#8230;rpm (5.0 rpm) so normally I stop MySQL, remove the enterprise rpm and install the advanced rpm. That starts the server and the slave on a box which is not completely &#8220;stable&#8221;. Solution is to add slave-skip-start to /etc/my.cnf but that should not be necessary as immediately after running mysql_upgrade you need to remove the value again.</p>
<p>Also during the upgrade process it is a good thing to avoid external client access so sometimes I also set the bind-address to 127.0.0.1 during the period of the upgrade.  That may not keep clients away if they are running on the local server but helps in many cases.</p>
<h2>Conclusions</h2>
<p>All this leads me to a simple conclusion: if you can, upgrade one box the slow way and then clone the other slaves from that. Cloning is simple and requires no thought so is a good idea.</p>
<p>The other conclusion based on the first one is that if you can: <strong>build a new master</strong>. That is clone a slave to make a new master. This will be the new master. Configure it to write it&#8217;s own binlogs and then you can move the existing slaves underneath the new one. Once all slaves are underneath the new master (left as the only slave of the original master) then you can simply point clients to the new master instead of the old one. That keeps down time to a minimum and avoids many problems.</p>
<p>As far as I know none of the comments I have made above are in the current 5.1 upgrade documentation. I have opened quite a few tickets requesting the documentation be improved and I guess that will happen slowly. For many people the points I have mentioned may seem irrelevant for their situation but for me they have caused a few problems. If you do not need to worry, then you can skip the documentation, otherwise if this were documented then you would be saved a few tears when least expecting problems.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=23236&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=23236&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://blog.wl0.org/2010/01/further-thoughts-on-mysql-upgrades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holiday gift &#8211; A deep look at MySQL 5.5 partitioning enhancements</title>
		<link>http://datacharmer.blogspot.com/2009/12/holiday-gift-deep-look-at-mysql-55.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=holiday-gift-a-deep-look-at-mysql-5-5-partitioning-enhancements</link>
		<comments>http://datacharmer.blogspot.com/2009/12/holiday-gift-deep-look-at-mysql-55.html#comments</comments>
		<pubDate>Thu, 24 Dec 2009 19:24:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[5.5]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[partitioning]]></category>
		<category><![CDATA[partitions]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-16959946.post-8463892460899345105</guid>
		<description><![CDATA[Half a day into my vacation, I managed to finish an article on a topic that has been intriguing me for a while. Since several colleagues were baffled by the semantics of the new enhancements of MySQL 5.5 partitions, after talking at length with the creator and the author of the manual pages, I produced this article: A deep look at MySQL 5.5 partitioning enhancements.Happy holidays!]]></description>
			<content:encoded><![CDATA[<table border="0"><tr><td><br /><a href="http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html"><img src="http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning/partitioning_placement_002.png" width="300" alt="A deep look at MySQL 5.5 partitioning enhancements" title="A deep look at MySQL 5.5 partitioning enhancements" border="0" /></a><br /></td><td><br />Half a day into my vacation, I managed to finish an article on a topic that has been intriguing me for a while. <br />Since several colleagues were baffled by the semantics of the new enhancements of MySQL 5.5 partitions, after talking at length with the creator and the author of the manual pages, I produced this article: <a href="http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html">A deep look at MySQL 5.5 partitioning enhancements</a>.<br />Happy holidays!<br /></td></tr></table><div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-8463892460899345105?l=datacharmer.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=22793&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=22793&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://datacharmer.blogspot.com/2009/12/holiday-gift-deep-look-at-mysql-55.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partitioning with non integer values using triggers</title>
		<link>http://datacharmer.blogspot.com/2009/09/partitioning-with-non-integer-values.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=partitioning-with-non-integer-values-using-triggers</link>
		<comments>http://datacharmer.blogspot.com/2009/09/partitioning-with-non-integer-values.html#comments</comments>
		<pubDate>Tue, 15 Sep 2009 08:01:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[partitioning]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trigger]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-16959946.post-4109683230618884680</guid>
		<description><![CDATA[Looking at Bug#47310, which is a feature request that I hear frequently when I talk about partitions, I wrote a comment, suggesting triggers to work around the limitation.The reason for the limitation is that allowing arbitrary functions for partitioning was too complex and it was provoking crashes and other unpleasant side effects (see the discussion under bug#18198).But if you use a trigger, the resulting column is a plain integer, and many of the side effects disappear. The drawback is that you need to add a column to your table, and you need to use that column when searching for data. With that in mind, you can implement the workaround quite easily.USE test;DROP TABLE IF EXISTS users;CREATE TABLE users (        user_id int(10) NOT NULL,        username varchar(25) DEFAULT NULL,        dummy INT not null,        PRIMARY KEY (user_id, dummy),        UNIQUE KEY username(username,dummy)) ;CREATE TRIGGER users_biBEFORE INSERT ON usersFOR EACH ROWSET NEW.dummy = ASCII(LOWER(LEFT(NEW.username,1))); ALTER TABLE users PARTITION BY RANGE (dummy) (        PARTITION p0 VALUES LESS THAN  (96),  #being f        PARTITION p1 VALUES LESS THAN (109),  #being m        PARTITION p2 VALUES LESS THAN (115),  #being s        PARTITION p3 VALUES LESS THAN (122)   #being z); INSERT INTO users (user_id, username)VALUES (1,'Joe'), (2,'Sam'),(3,'Abe'),(4,'Rich');EXPLAIN PARTITIONS SELECT * FROM users where username = 'Abe'; # This simple query doesn't use partition pruning. # This is to be expected.EXPLAIN PARTITIONS SELECT * FROM users where dummy = ASCII('a') and username = 'Abe'; # Here, the partition pruning kicks in, at the price of an extra# condition in the query.]]></description>
			<content:encoded><![CDATA[Looking at <a href="http://bugs.mysql.com/bug.php?id=47310">Bug#47310</a>, which is a feature request that I hear frequently when I talk about partitions, I wrote a comment, suggesting triggers to work around the limitation.<br />The reason for the limitation is that allowing arbitrary functions for partitioning was too complex and it was provoking crashes and other unpleasant side effects (see the discussion under <a href="http://bugs.mysql.com/bug.php?id=18198">bug#18198</a>).<br />But if you use a trigger, the resulting column is a plain integer, and many of the side effects disappear. The drawback is that you need to <i>add a column</i> to your table, and you need to use that column when searching for data. With that in mind, you can implement the workaround quite easily.<br /><pre><br />USE test;<br />DROP TABLE IF EXISTS users;<br /><br />CREATE TABLE users (<br />        user_id int(10) NOT NULL,<br />        username varchar(25) DEFAULT NULL,<br />        dummy INT not null,<br />        PRIMARY KEY (user_id, dummy),<br />        UNIQUE KEY username(username,dummy)<br />) ;<br /><br />CREATE TRIGGER users_bi<br />BEFORE INSERT ON users<br />FOR EACH ROW<br />SET NEW.dummy = ASCII(LOWER(LEFT(NEW.username,1))); <br /><br />ALTER TABLE users PARTITION BY RANGE (dummy) (<br />        PARTITION p0 VALUES LESS THAN  (96),  #being f<br />        PARTITION p1 VALUES LESS THAN (109),  #being m<br />        PARTITION p2 VALUES LESS THAN (115),  #being s<br />        PARTITION p3 VALUES LESS THAN (122)   #being z<br />); <br /><br />INSERT INTO users (user_id, username)<br />VALUES (1,'Joe'), (2,'Sam'),(3,'Abe'),(4,'Rich');<br /><br />EXPLAIN PARTITIONS SELECT * FROM users <br />where username = 'Abe'; <br /># This simple query doesn't use partition pruning. <br /># This is to be expected.<br /><br />EXPLAIN PARTITIONS SELECT * FROM users <br />where dummy = ASCII('a') and username = 'Abe'; <br /># Here, the partition pruning kicks in, at the price of an extra<br /># condition in the query.<br /></pre><div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-4109683230618884680?l=datacharmer.blogspot.com" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=21117&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=21117&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://datacharmer.blogspot.com/2009/09/partitioning-with-non-integer-values.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Labs provide server snapshots</title>
		<link>http://blogs.sun.com/theaquarium/entry/mysql_labs_provides_server_snapshots?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mysql-labs-provide-server-snapshots</link>
		<comments>http://blogs.sun.com/theaquarium/entry/mysql_labs_provides_server_snapshots#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:00:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[binaries]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blogs.sun.com/theaquarium/entry/mysql_labs_provides_server_snapshots</guid>
		<description><![CDATA[






MySQL opens its labs to the community. Users who want to test the early builds, before they are released for general availability can get them from  MySQL Labs.



There is a detailed announcement that warns against using these binaries in production, but encourages everyone to test them. A companion tutorial explains how to use the snapshots to test the InnoDB plugin, which was released recently, and it is included in the latest MySQL 5.1 binaries.
]]></description>
			<content:encoded><![CDATA[<table><tr><td>
<a href="http://labs.mysql.com" title="MySQL Labs" >
<img src="http://blogs.sun.com/datacharmer/resource/mysql_labs_2.png" alt="MySQL Labs" width="200" hspace="4" vspace="4" align="left" />
</a>
</td>
<td valign="top">
<p>
MySQL opens its labs to the community. Users who want to test the early builds, before they are released for general availability can get them from <a href="http://labs.mysql.com"> MySQL Labs</a>.
</p>

</td></tr></table>
<p>There is a detailed <a href="http://blogs.sun.com/datacharmer/entry/mysql_labs_server_snapshots_available">announcement</a> that warns against using these binaries in production, but encourages everyone to test them. A companion <a href="http://datacharmer.blogspot.com/2009/08/testing-innodb-plugin-with-mysql.html">tutorial</a> explains how to use the snapshots to test the InnoDB plugin, which was <a href="http://blogs.sun.com/theaquarium/entry/innodb_plugin_1_0_4">released</a> recently, and it is included in the latest MySQL 5.1 binaries.
</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20738&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20738&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://blogs.sun.com/theaquarium/entry/mysql_labs_provides_server_snapshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing the InnoDB plugin with MySQL snapshots</title>
		<link>http://datacharmer.blogspot.com/2009/08/testing-innodb-plugin-with-mysql.html?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=testing-the-innodb-plugin-with-mysql-snapshots</link>
		<comments>http://datacharmer.blogspot.com/2009/08/testing-innodb-plugin-with-mysql.html#comments</comments>
		<pubDate>Tue, 18 Aug 2009 10:34:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-16959946.post-7576101064425861750</guid>
		<description><![CDATA[The cat is out of the bag.MySQL 5.1 will include the InnoDB plugin, and thanks to labs.mysql.com you can try the new version right away.Here is a step-by-step guide to testing the InnoDB plugin with MySQL snapshot 5.1.39 and MySQL Sandbox.1. Install MySQL::SandboxThis is a straightforward part. Please refer to the manual for the details.2. get the binaries Check the list of available binaries and download the one that matches your architecture and operating system.3. Install the sandboxSince we want to use the InnoDB plugin, we need to start the Sandbox with the builtin innodb engine disabled.make_sandbox \/path/to/mysql-5.1.39-snapshot20090812-osx10.5-i386.tar.gz \-c ignore-builtin-innodb The option passed with "-c" will be written to the options file.Make sure that the sandbox is installed and the server starts. If it doesn't, check the error log at $HOME/sandboxes/msb_5_1_39/data/msandbox.err and try to figure out what happened.4. Check the available engines~/sandboxes/msb_5_1_39/useWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.1.39-snapshot20090812 Source distributionType 'help;' or '\h' for help. Type '\c' to clear the current input statement.select engine, support from information_schema.engines;+------------+---------+&#124; engine     &#124; support &#124;+------------+---------+&#124; MyISAM     &#124; DEFAULT &#124;&#124; MRG_MYISAM &#124; YES     &#124;&#124; BLACKHOLE  &#124; YES     &#124;&#124; CSV        &#124; YES     &#124;&#124; MEMORY     &#124; YES     &#124;&#124; FEDERATED  &#124; NO      &#124;&#124; ARCHIVE    &#124; YES     &#124;+------------+---------+As you can see, InnoDB is not in the list.5. Install the innodb plugininstall plugin innodb soname 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.85 sec)select @@innodb_version;+------------------+&#124; @@innodb_version &#124;+------------------+&#124; 1.0.4            &#124;+------------------+6. Install the additional INFORMATION SCHEMA tablesINSTALL PLUGIN INNODB_TRX SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)INSTALL PLUGIN INNODB_LOCKS SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)INSTALL PLUGIN INNODB_LOCK_WAITS SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)INSTALL PLUGIN INNODB_CMP SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)INSTALL PLUGIN INNODB_CMP_RESET SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)INSTALL PLUGIN INNODB_CMPMEM SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)INSTALL PLUGIN INNODB_CMPMEM_RESET SONAME 'ha_innodb_plugin.so';Query OK, 0 rows affected (0.00 sec)6. Finally, check the resultsselect plugin_name, plugin_type, plugin_status from information_schema.plugins;+---------------------+--------------------+---------------+&#124; plugin_name         &#124; plugin_type        &#124; plugin_status &#124;+---------------------+--------------------+---------------+&#124; binlog              &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; partition           &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; ARCHIVE             &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; BLACKHOLE           &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; CSV                 &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; FEDERATED           &#124; STORAGE ENGINE     &#124; DISABLED      &#124;&#124; MEMORY              &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; MyISAM              &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; MRG_MYISAM          &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; InnoDB              &#124; STORAGE ENGINE     &#124; ACTIVE        &#124;&#124; INNODB_TRX          &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;&#124; INNODB_LOCKS        &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;&#124; INNODB_LOCK_WAITS   &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;&#124; INNODB_CMP          &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;&#124; INNODB_CMP_RESET    &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;&#124; INNODB_CMPMEM       &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;&#124; INNODB_CMPMEM_RESET &#124; INFORMATION SCHEMA &#124; ACTIVE        &#124;+---------------------+--------------------+---------------+Now you can read the InnoDB plugin manual and have as much fun as you can.]]></description>
			<content:encoded><![CDATA[<table border="0"><tbody><tr><td><br /><a href="http://www2.blogger.com/post-create.g?blogID=16959946"><img src="http://lh4.ggpht.com/_gVfZHGgf5LA/SoqxvSbEF6I/AAAAAAAAAuM/F8oJ79yCS7o/s576/plug2_800x679.JPG" alt="MySQL plugins" title="MySQL Plugins" width="300" border="0" /></a><br /></td><td><br /><a href="http://blogs.sun.com/datacharmer/entry/mysql_labs_server_snapshots_available">The cat</a> is <a href="http://mituzas.lt/2009/08/18/plugin-and-5-1/">out of the bag</a>.<br />MySQL 5.1 will include the InnoDB plugin, and thanks to <a href="http://labs.mysql.com/"><br />labs.mysql.com</a> you can try the new version right away.<br />Here is a step-by-step guide to testing the InnoDB plugin with MySQL snapshot 5.1.39 and MySQL Sandbox.<br /></td></tr></tbody></table><br /><dl><dt><b>1. Install <a href="http://search.cpan.org/~gmax/MySQL-Sandbox-3.0.04/lib/MySQL/Sandbox.pm#INSTALLATION">MySQL::Sandbox</a></b></dt><dd>This is a straightforward part. Please refer to the <a href="http://search.cpan.org/~gmax/MySQL-Sandbox-3.0.04/lib/MySQL/Sandbox.pm#INSTALLATION">manual</a> for the details.</dd><br /><dt><b>2. get the <a href="http://labs.mysql.com/">binaries</a> </b></dt><dd>Check the list of available binaries and download the one that matches your architecture and operating system.</dd><br /><dt><b>3. Install the sandbox</b></dt><dd>Since we want to use the InnoDB plugin, we need to start the Sandbox with the builtin innodb engine disabled.<br /><pre>make_sandbox \<br />/path/to/mysql-5.1.39-snapshot20090812-osx10.5-i386.tar.gz \<br />-c ignore-builtin-innodb<br /></pre> The option passed with "-c" will be written to the options file.<br />Make sure that the sandbox is installed and the server starts. If it doesn't, check the error log at $HOME/sandboxes/msb_5_1_39/data/msandbox.err and try to figure out what happened.<br /></dd><br /><dt><b>4. Check the available engines</b></dt><dd><pre>~/sandboxes/msb_5_1_39/use<br />Welcome to the MySQL monitor.  Commands end with ; or \g.<br />Your MySQL connection id is 2<br />Server version: 5.1.39-snapshot20090812 Source distribution<br /><br />Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br /><br />select engine, support from information_schema.engines;<br />+------------+---------+<br />| engine     | support |<br />+------------+---------+<br />| MyISAM     | DEFAULT |<br />| MRG_MYISAM | YES     |<br />| BLACKHOLE  | YES     |<br />| CSV        | YES     |<br />| MEMORY     | YES     |<br />| FEDERATED  | NO      |<br />| ARCHIVE    | YES     |<br />+------------+---------+<br /></pre>As you can see, InnoDB is not in the list.</dd><br /><dt><b>5. Install the innodb plugin</b></dt><dd><pre>install plugin innodb soname 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.85 sec)<br /><br />select @@innodb_version;<br />+------------------+<br />| @@innodb_version |<br />+------------------+<br />| 1.0.4            |<br />+------------------+<br /></pre></dd><br /><dt><b>6. Install the additional INFORMATION SCHEMA tables</b></dt><dd><pre>INSTALL PLUGIN INNODB_TRX SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /><br />INSTALL PLUGIN INNODB_LOCKS SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /><br />INSTALL PLUGIN INNODB_LOCK_WAITS SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /><br />INSTALL PLUGIN INNODB_CMP SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /><br />INSTALL PLUGIN INNODB_CMP_RESET SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /><br />INSTALL PLUGIN INNODB_CMPMEM SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /><br />INSTALL PLUGIN INNODB_CMPMEM_RESET SONAME 'ha_innodb_plugin.so';<br />Query OK, 0 rows affected (0.00 sec)<br /></pre></dd><br /><dt><b>6. Finally, check the results</b><br /></dt><dd><pre>select plugin_name, plugin_type, plugin_status from information_schema.plugins;<br />+---------------------+--------------------+---------------+<br />| plugin_name         | plugin_type        | plugin_status |<br />+---------------------+--------------------+---------------+<br />| binlog              | STORAGE ENGINE     | ACTIVE        |<br />| partition           | STORAGE ENGINE     | ACTIVE        |<br />| ARCHIVE             | STORAGE ENGINE     | ACTIVE        |<br />| BLACKHOLE           | STORAGE ENGINE     | ACTIVE        |<br />| CSV                 | STORAGE ENGINE     | ACTIVE        |<br />| FEDERATED           | STORAGE ENGINE     | DISABLED      |<br />| MEMORY              | STORAGE ENGINE     | ACTIVE        |<br />| MyISAM              | STORAGE ENGINE     | ACTIVE        |<br />| MRG_MYISAM          | STORAGE ENGINE     | ACTIVE        |<br />| InnoDB              | STORAGE ENGINE     | ACTIVE        |<br />| INNODB_TRX          | INFORMATION SCHEMA | ACTIVE        |<br />| INNODB_LOCKS        | INFORMATION SCHEMA | ACTIVE        |<br />| INNODB_LOCK_WAITS   | INFORMATION SCHEMA | ACTIVE        |<br />| INNODB_CMP          | INFORMATION SCHEMA | ACTIVE        |<br />| INNODB_CMP_RESET    | INFORMATION SCHEMA | ACTIVE        |<br />| INNODB_CMPMEM       | INFORMATION SCHEMA | ACTIVE        |<br />| INNODB_CMPMEM_RESET | INFORMATION SCHEMA | ACTIVE        |<br />+---------------------+--------------------+---------------+<br /></pre></dd></dl>Now you can read the <a href="http://www.innodb.com/doc/innodb_plugin-1.0/">InnoDB plugin manual</a> and have as much fun as you can.<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-7576101064425861750?l=datacharmer.blogspot.com" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20709&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=20709&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://datacharmer.blogspot.com/2009/08/testing-innodb-plugin-with-mysql.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
