<?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, 24 May 2012 05:41:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>MySQL Sandbox at the OTN MySQL Developers day in Paris, March 21st</title>
		<link>http://datacharmer.blogspot.com/2012/03/mysql-sandbox-at-otn-mysql-developers.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-sandbox-at-the-otn-mysql-developers-day-in-paris-march-21st</link>
		<comments>http://datacharmer.blogspot.com/2012/03/mysql-sandbox-at-otn-mysql-developers.html#comments</comments>
		<pubDate>Tue, 13 Mar 2012 08:57:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.0]]></category>
		<category><![CDATA[5.1]]></category>
		<category><![CDATA[5.5]]></category>
		<category><![CDATA[5.6]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Europe]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sandbox]]></category>

		<guid isPermaLink="false">http://planetmysql.ru/?guid=c30c3c04a7733d33ea08a522aceb15c3</guid>
		<description><![CDATA[On March 21st I will be in Paris, to attend the OTN MySQL Developers Day.Oracle is organizing these events all over the world, and although the majority are in the US, some of them are touching the good old European continent.Previous events were an all-Oracle show. Recently, the MySQL Community team has been asking for cooperation from the community, and in such capacity I am also presenting at the event, on the topic of testing early releases of MySQL in a sandbox. Of course, this is one of my favorite topics, but it is quite appropriate in this period, when Oracle has released a whole lot of preview features in its MySQL Labs. Which is another favorite topic of mine, since I was the one who insisted for having the Labs when I was working in the community team. It's nice to see that the labs are still in place, and being put to good use.Speaking of sandboxes, I was making some quick tests yesterday, and I installed 15 sandboxes at once (all different versions, from 5.0.91 to 5.6.5). Installing a single sandbox, depending on the version, takes from 5 to 19 seconds.Do you know how long it takes to install 15 sandboxes, completely, from tarball to working conditions? It takes 19 seconds. How's so? It's because I have been working at a large project where we are dealing with many replicated clusters spread across three continents. Administering these clusters is a problem in itself, and so we are using tools to do our work in parallel. At the same time, using a host with a fast 16 core CPU I can install many sandboxes at once. It's a real joy to see software behaving efficiently the way it should!It works so fast, in fact, that I found a race condition bug. If you install more than one sandbox at once, the MySQL bootstrap process may try to open the same temporary file from two different servers. That's because I did not indicate a dedicated temporary directory for the bootstrap (I was using one only for the installed sandbox). When this happens, you may find that instead of 15 sandboxes you have installed only 9 or 11. So I fixed the bug, by adding --tmpdir to mysql_install_db, and now you can install more than one sandbox in parallel.]]></description>
			<content:encoded><![CDATA[On March 21st I will be in Paris, to attend the <a href="http://www.oracle.com/webapps/events/ns/EventsDetail.jsp?p_eventId=149253&amp;src=7314534&amp;src=7314534&amp;Act=259">OTN MySQL Developers Day</a>.Oracle is organizing these events all over the world, and although the majority are in the US, some of them are touching the good old European continent.Previous events were an all-Oracle show. Recently, the MySQL Community team has been asking for cooperation from the community, and in such capacity I am also presenting at the event, on the topic of testing early releases of MySQL in a sandbox. Of course, this is one of my favorite topics, but it is quite appropriate in this period, when Oracle has released a whole lot of preview features in its <a href="http://labs.mysql.com/">MySQL Labs</a>. Which is another favorite topic of mine, since I was the one who insisted for having the Labs when I was working in the community team. It's nice to see that the labs are still in place, and being put to good use.<p><img src="http://lh6.ggpht.com/-JJg6UwmaRXU/T18L57WzI_I/AAAAAAAABQc/fv8fINGHReE/MySQL_Sandbox.png?imgmax=800" alt="MySQL Sandbox" title="MySQL_Sandbox.png" border="0" width="600" height="545" /></p>Speaking of sandboxes, I was making some quick tests yesterday, and I installed 15 sandboxes at once (all different versions, from 5.0.91 to 5.6.5). Installing a single sandbox, depending on the version, takes from 5 to 19 seconds.Do you know how long it takes to install 15 sandboxes, completely, from tarball to working conditions? It takes 19 seconds. How's so? It's because I have been working at a large project where we are dealing with many replicated clusters spread across three continents. Administering these clusters is a problem in itself, and so we are using tools to do our work in parallel. At the same time, using a host with a fast 16 core CPU I can install many sandboxes at once. It's a real joy to see software behaving efficiently the way it should!It works so fast, in fact, that I found a race condition bug. If you install more than one sandbox at once, the MySQL bootstrap process may try to open the same temporary file from two different servers. That's because I did not indicate a dedicated temporary directory for the bootstrap (I was using one only for the installed sandbox). When this happens, you may find that instead of 15 sandboxes you have installed only 9 or 11. So I fixed the bug, by adding <i>--tmpdir</i> to <i>mysql_install_db</i>, and now you can install more than one sandbox in parallel.<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-5623504402958128054?l=datacharmer.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=32309&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=32309&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2012/03/13/mysql-sandbox-at-the-otn-mysql-developers-day-in-paris-march-21st/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Sandbox at the OTN MySQL Developers day in Paris, March 21st</title>
		<link>http://datacharmer.blogspot.com/2012/03/mysql-sandbox-at-otn-mysql-developers.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-sandbox-at-the-otn-mysql-developers-day-in-paris-march-21st</link>
		<comments>http://datacharmer.blogspot.com/2012/03/mysql-sandbox-at-otn-mysql-developers.html#comments</comments>
		<pubDate>Tue, 13 Mar 2012 08:57:00 +0000</pubDate>
		<dc:creator>Giuseppe Maxia</dc:creator>
				<category><![CDATA[5.0]]></category>
		<category><![CDATA[5.1]]></category>
		<category><![CDATA[5.5]]></category>
		<category><![CDATA[5.6]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Europe]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sandbox]]></category>

		<guid isPermaLink="false">http://planetmysql.ru/?guid=c30c3c04a7733d33ea08a522aceb15c3</guid>
		<description><![CDATA[On March 21st I will be in Paris, to attend the OTN MySQL Developers Day.Oracle is organizing these events all over the world, and although the majority are in the US, some of them are touching the good old European continent.Previous events were an all-Oracle show. Recently, the MySQL Community team has been asking for cooperation from the community, and in such capacity I am also presenting at the event, on the topic of testing early releases of MySQL in a sandbox. Of course, this is one of my favorite topics, but it is quite appropriate in this period, when Oracle has released a whole lot of preview features in its MySQL Labs. Which is another favorite topic of mine, since I was the one who insisted for having the Labs when I was working in the community team. It's nice to see that the labs are still in place, and being put to good use.Speaking of sandboxes, I was making some quick tests yesterday, and I installed 15 sandboxes at once (all different versions, from 5.0.91 to 5.6.5). Installing a single sandbox, depending on the version, takes from 5 to 19 seconds.Do you know how long it takes to install 15 sandboxes, completely, from tarball to working conditions? It takes 19 seconds. How's so? It's because I have been working at a large project where we are dealing with many replicated clusters spread across three continents. Administering these clusters is a problem in itself, and so we are using tools to do our work in parallel. At the same time, using a host with a fast 16 core CPU I can install many sandboxes at once. It's a real joy to see software behaving efficiently the way it should!It works so fast, in fact, that I found a race condition bug. If you install more than one sandbox at once, the MySQL bootstrap process may try to open the same temporary file from two different servers. That's because I did not indicate a dedicated temporary directory for the bootstrap (I was using one only for the installed sandbox). When this happens, you may find that instead of 15 sandboxes you have installed only 9 or 11. So I fixed the bug, by adding --tmpdir to mysql_install_db, and now you can install more than one sandbox in parallel.]]></description>
			<content:encoded><![CDATA[On March 21st I will be in Paris, to attend the <a href="http://www.oracle.com/webapps/events/ns/EventsDetail.jsp?p_eventId=149253&amp;src=7314534&amp;src=7314534&amp;Act=259">OTN MySQL Developers Day</a>.Oracle is organizing these events all over the world, and although the majority are in the US, some of them are touching the good old European continent.Previous events were an all-Oracle show. Recently, the MySQL Community team has been asking for cooperation from the community, and in such capacity I am also presenting at the event, on the topic of testing early releases of MySQL in a sandbox. Of course, this is one of my favorite topics, but it is quite appropriate in this period, when Oracle has released a whole lot of preview features in its <a href="http://labs.mysql.com/">MySQL Labs</a>. Which is another favorite topic of mine, since I was the one who insisted for having the Labs when I was working in the community team. It's nice to see that the labs are still in place, and being put to good use.<p><img src="http://lh6.ggpht.com/-JJg6UwmaRXU/T18L57WzI_I/AAAAAAAABQc/fv8fINGHReE/MySQL_Sandbox.png?imgmax=800" alt="MySQL Sandbox" title="MySQL_Sandbox.png" border="0" width="600" height="545" /></p>Speaking of sandboxes, I was making some quick tests yesterday, and I installed 15 sandboxes at once (all different versions, from 5.0.91 to 5.6.5). Installing a single sandbox, depending on the version, takes from 5 to 19 seconds.Do you know how long it takes to install 15 sandboxes, completely, from tarball to working conditions? It takes 19 seconds. How's so? It's because I have been working at a large project where we are dealing with many replicated clusters spread across three continents. Administering these clusters is a problem in itself, and so we are using tools to do our work in parallel. At the same time, using a host with a fast 16 core CPU I can install many sandboxes at once. It's a real joy to see software behaving efficiently the way it should!It works so fast, in fact, that I found a race condition bug. If you install more than one sandbox at once, the MySQL bootstrap process may try to open the same temporary file from two different servers. That's because I did not indicate a dedicated temporary directory for the bootstrap (I was using one only for the installed sandbox). When this happens, you may find that instead of 15 sandboxes you have installed only 9 or 11. So I fixed the bug, by adding <i>--tmpdir</i> to <i>mysql_install_db</i>, and now you can install more than one sandbox in parallel.<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/16959946-5623504402958128054?l=datacharmer.blogspot.com" alt="" /></div><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=32309&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=32309&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2012/03/13/mysql-sandbox-at-the-otn-mysql-developers-day-in-paris-march-21st/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better Controlling MySQL Memory Usage</title>
		<link>http://blog.wl0.org/2012/01/better-controlling-mysql-memory-usage/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=better-controlling-mysql-memory-usage</link>
		<comments>http://blog.wl0.org/2012/01/better-controlling-mysql-memory-usage/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 23:32:53 +0000</pubDate>
		<dc:creator>Simon Mudd</dc:creator>
				<category><![CDATA[5.1]]></category>
		<category><![CDATA[5.5]]></category>
		<category><![CDATA[5.6]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[memory allocation]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[resource control]]></category>
		<category><![CDATA[swapping]]></category>

		<guid isPermaLink="false">http://blog.wl0.org/?p=512</guid>
		<description><![CDATA[MySQL, like a lot of other software, has many knobs you can tweak. Most of these knobs may affect behaviour, but more importantly most affect the memory usage of the server, so getting these settings right is very important.
Most of MySQL&#8217;s memory is really used just as a cache, in one form or another, information that otherwise is on disk. So ensuring you have as large a cache as possible is important. However, making these memory sizes too large will trigger the server to start swapping and possibly can cause it to crash or cause the kernel to kill the process when it runs out of memory.  So that&#8217;s something we want to avoid.
Certain settings affect memory allocation on a per connection/thread basis, being bounded by thread_cache_size and max_connections.  If you configure for the worst behaviour (max_connections) you may end up not actually using all the memory you have available, memory which normally could be used for other purposes.
Recently a server I managed was configured incorrectly with a large sort_buffer_size (4M to 256M) and larger read_buffer_size (4M to 20M).  The change in configuration on first glance looks quite innocent, and not noticing that these are per-connection settings this got rolled out. max_connections on this server was set to 1000, while normally there were ~40 connections of which only a few were active. The mysqld memory footprint on startup looked fine. In fact under normal usage it also worked fine. However spiky load suddenly changed this nice behaviour: as configured mysqld ramped up the thread count and hence memory usage, resulting in swapping and finally server death&#8230;
The fault of course was mine for not noticing, but this has been an issue with MySQL forever.  Most other RDBMSes manage memory slightly differently: you define how much memory you want to use (maximum), this is optinally locked into memory, and further requests for different buffers are taken from this global pool.  That is much safer, avoids unexpected swapping, or memory over-allocation, but does raise the question of what happens when a memory request can not be honoured.
Initially I would expect two different behaviours: either

kill a thread whose memory can not be allocated, or
wait a certain time to allocate that memory, after which it gets killed anyway.

Option (2) is probably saner, and possibly some sort of deadlock detection can kick if in all threads are waiting for memory, perhaps killing the younger thread, or thread which has done least work first. Possibly there are other better ways of doing this?
I can imagine that changing MySQL&#8217;s current behaviour to do something like this could be quite hard, especially as ideally the engines would also use the same memory management mechanisms, but I see this as being a good thing and would make MySQL more robust, especially under load, which is after all what counts.  Of course this will not happen in today&#8217;s 5.5 GA version, or tomorrow&#8217;s 5.6 version which is probably likely to appear some time this year. That&#8217;s a major change. It would be nice if Oracle look at this for 5.7 as a way of ensuring that when resource usage does come under pressure MySQL does not go heads up, but attempts to use the allocated resources as best as possible.
In the meantime what would help would be:

better documentation so we can see clearly how all mysql memory is allocated. There are several web pages commenting ways to calculate this, but certainly no definitive guide.
The InnoDB engine&#8217;s documentation talks about memory usage and most people think that the innodb_buffer_pool_size is the main setting. yet read further and there&#8217;s talk of an overhead of perhaps 1/8th. I have recently been playing with innodb_buffer_pool_instances settings &#62; 1 (using values in the range of 20-40) and am inclined to think that this increases that overhead somewhat more, yet there&#8217;s no documentation on this and whether my guess is right or not. Please InnoDB developers improve your documentation, if only to prove me wrong.
Ideally some tools to tell you if you server is possibly misconfigured. Coming from a Sybase environment I&#8217;d be tempted to suggest a stored procedure in the mysql database which can tell you total memory usage and how it is broken down as doing this with a single SELECT is going to be tricky.

Then once that is done consider adding some extra variable to enable total memory usage to be controlled. I made a feature request for this at http://bugs.mysql.com/?id=64108. If you think this feature might interest you please let Oracle know.]]></description>
			<content:encoded><![CDATA[<p>MySQL, like a lot of other software, has many knobs you can tweak. Most of these knobs may affect behaviour, but more importantly most affect the memory usage of the server, so getting these settings right is very important.</p>
<p>Most of MySQL&#8217;s memory is really used just as a cache, in one form or another, information that otherwise is on disk. So ensuring you have as large a cache as possible is important. However, making these memory sizes too large will trigger the server to start swapping and possibly can cause it to crash or cause the kernel to kill the process when it runs out of memory.  So that&#8217;s something we want to avoid.</p>
<p>Certain settings affect memory allocation on a per connection/thread basis, being bounded by thread_cache_size and max_connections.  If you configure for the worst behaviour (max_connections) you may end up not actually using all the memory you have available, memory which normally could be used for other purposes.</p>
<p>Recently a server I managed was configured incorrectly with a large sort_buffer_size (4M to 256M) and larger read_buffer_size (4M to 20M).  The change in configuration on first glance looks quite innocent, and not noticing that these are per-connection settings this got rolled out. max_connections on this server was set to 1000, while normally there were ~40 connections of which only a few were active. The mysqld memory footprint on startup looked fine. In fact under normal usage it also worked fine. However spiky load suddenly changed this <em>nice behaviour</em>: as configured mysqld ramped up the thread count and hence memory usage, resulting in swapping and finally server death&#8230;</p>
<p>The fault of course was mine for not noticing, but this has been an issue with MySQL forever.  Most other RDBMSes manage memory slightly differently: you define how much memory you want to use (maximum), this is optinally locked into memory, and further requests for different <em>buffers</em> are taken from this <em>global pool</em>.  That is much safer, avoids unexpected swapping, or memory over-allocation, but does raise the question of what happens when a memory request can not be honoured.</p>
<p>Initially I would expect two different behaviours: either</p>
<ol>
<li>kill a thread whose memory can not be allocated, or</li>
<li>wait a certain time to allocate that memory, after which it gets killed anyway.</li>
</ol>
<p>Option (2) is probably saner, and possibly some sort of deadlock detection can kick if in all threads are waiting for memory, perhaps killing the <em>younger thread</em>, or thread which has done least work first. Possibly there are other better ways of doing this?</p>
<p>I can imagine that changing MySQL&#8217;s current behaviour to do something like this could be quite hard, especially as ideally the engines would also use the same memory management mechanisms, but I see this as being a good thing and would make MySQL more robust, especially under load, which is after all what counts.  Of course this will not happen in today&#8217;s 5.5 GA version, or tomorrow&#8217;s 5.6 version which is probably likely to appear some time this year. That&#8217;s a major change. It would be nice if Oracle look at this for 5.7 as a way of ensuring that when resource usage does come under pressure MySQL does not go heads up, but attempts to use the allocated resources as best as possible.</p>
<p>In the meantime what would help would be:</p>
<ul>
<li>better documentation so we can see clearly how all mysql memory is allocated. There are several web pages commenting ways to calculate this, but certainly no definitive guide.</li>
<li>The InnoDB engine&#8217;s documentation talks about memory usage and most people think that the innodb_buffer_pool_size is the main setting. yet read further and there&#8217;s talk of an overhead of perhaps 1/8th. I have recently been playing with innodb_buffer_pool_instances settings &gt; 1 (using values in the range of 20-40) and am inclined to think that this increases that overhead somewhat more, yet there&#8217;s no documentation on this and whether my guess is right or not. Please InnoDB developers improve your documentation, if only to prove me wrong.</li>
<li>Ideally some tools to tell you if you server is possibly misconfigured. Coming from a Sybase environment I&#8217;d be tempted to suggest a stored procedure in the mysql database which can tell you total memory usage and how it is broken down as doing this with a single SELECT is going to be tricky.</li>
</ul>
<p>Then once that is done consider adding some extra variable to enable total memory usage to be controlled. I made a feature request for this at <a title="Provide a global maximum_memory setting to limit unexpected memory usage" href="http://bugs.mysql.com/?id=64108" >http://bugs.mysql.com/?id=64108</a>. If you think this feature might interest you please let Oracle know.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31791&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31791&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2012/01/25/better-controlling-mysql-memory-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 5.0 and 5.1 available on Solaris 11</title>
		<link>http://blogs.oracle.com/partnertech/entry/mysql_5_0_and_5?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-5-0-and-5-1-available-on-solaris-11</link>
		<comments>http://blogs.oracle.com/partnertech/entry/mysql_5_0_and_5#comments</comments>
		<pubDate>Wed, 18 Jan 2012 07:34:49 +0000</pubDate>
		<dc:creator>Sun Partner Technology</dc:creator>
				<category><![CDATA[11]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[5.1]]></category>
		<category><![CDATA[available]]></category>
		<category><![CDATA[certified]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://blogs.oracle.com/partnertech/entry/mysql_5_0_and_5</guid>
		<description><![CDATA[The installation through the Solaris repository is as simple as typing: 
  $ pkg install&#160;mysql-50 
  to obtain MySQL 5.0.91 (status Jan 18, 2012) or click on this link to launch the interactive installer. 
  $ pkg install&#160;mysql-51 
  to obtain MySQL 5.1.37 (status Jan. 18, 2012) or click on this link to launch the interactive installer.]]></description>
			<content:encoded><![CDATA[<p>The installation through the <a href="http://pkg.oracle.com">Solaris repository</a> is as simple as typing:</p> 
  <pre>$ pkg install&nbsp;mysql-50</pre> 
  <p>to obtain MySQL 5.0.91 (status Jan 18, 2012) or click on this <a href="http://pkg.oracle.com/solaris/release/p5i/0/database/mysql-50.p5i" title="package manager">link to launch the interactive installer</a>.</p> 
  <pre>$ pkg install&nbsp;mysql-51</pre> 
  <p>to obtain MySQL 5.1.37 (status Jan. 18, 2012) or click on this <a href="http://pkg.oracle.com/solaris/release/p5i/0/database/mysql-51.p5i" title="package manager">link to launch the interactive installer</a>.</p><br/>PlanetMySQL Voting:
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31643&vote=1&apivote=1">Vote UP</a> /
	 <a href="http://planet.mysql.com/entry/vote/?entry_id=31643&vote=-1&apivote=1">Vote DOWN</a>]]></content:encoded>
			<wfw:commentRss>http://planetmysql.ru/2012/01/18/mysql-5-0-and-5-1-available-on-solaris-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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&#038;utm_medium=rss&#038;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[mysql]]></category>
		<category><![CDATA[Pythian]]></category>
		<category><![CDATA[Pythian Appearances]]></category>
		<category><![CDATA[Technical Blog]]></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://planetmysql.ru/2010/07/26/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&#038;utm_medium=rss&#038;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[antelope]]></category>
		<category><![CDATA[barracuda]]></category>
		<category><![CDATA[compressed]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[InnoDB]]></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://planetmysql.ru/2010/05/23/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 &#8212; Two strong reasons to upgrade</title>
		<link>http://blogs.sun.com/datacharmer/entry/mysql_5_1_47_released?utm_source=rss&#038;utm_medium=rss&#038;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://planetmysql.ru/2010/05/21/mysql-5-1-47-and-5-0-91-released-two-strong-reasons-to-upgrade/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&#038;utm_medium=rss&#038;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[bugs]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[partitioning]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false"></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://planetmysql.ru/2010/05/06/two-quick-performance-tips-with-mysql-5-1-partitions/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&#038;utm_medium=rss&#038;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[advanced]]></category>
		<category><![CDATA[Databases]]></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://planetmysql.ru/2010/01/30/further-thoughts-on-mysql-upgrades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holiday gift &#8212; 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&#038;utm_medium=rss&#038;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"></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://planetmysql.ru/2009/12/24/holiday-gift-a-deep-look-at-mysql-5-5-partitioning-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

