<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Hacking to make ALTER TABLE online for certain changes</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/</link>
	<description>Everything about MySQL Performance</description>
	<pubDate>Tue, 14 Oct 2008 07:08:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Picking datatype for STATUS fields &#124; MySQL Performance Blog</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-343315</link>
		<dc:creator>Picking datatype for STATUS fields &#124; MySQL Performance Blog</dc:creator>
		<pubDate>Mon, 11 Aug 2008 00:16:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-343315</guid>
		<description>[...] (ALTER TABLE) causes table rebuild which is not acceptable for many environments. It is possible to hack this around though I would not like to do this as a standard production practice. It is also worth to note ENUM [...]</description>
		<content:encoded><![CDATA[<p>[...] (ALTER TABLE) causes table rebuild which is not acceptable for many environments. It is possible to hack this around though I would not like to do this as a standard production practice. It is also worth to note ENUM [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walter Heck</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-315611</link>
		<dc:creator>Walter Heck</dc:creator>
		<pubDate>Fri, 20 Jun 2008 23:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-315611</guid>
		<description>Does anyone know how to find out which commands will lead to a table rebuild? 
More specifically: how do I add comments to tables and columns without rebuilding them?</description>
		<content:encoded><![CDATA[<p>Does anyone know how to find out which commands will lead to a table rebuild?<br />
More specifically: how do I add comments to tables and columns without rebuilding them?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trent Hornibrook</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-303693</link>
		<dc:creator>Trent Hornibrook</dc:creator>
		<pubDate>Thu, 22 May 2008 11:44:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-303693</guid>
		<description>Hi guys

I tried this though instead changed a signed INT to an unsigned INT. 

MySQL uses twos complement for negative ints and knowing that a table doesn’t contain any negative values, it was possible to just tell MySQL to use unsigned ints instead of signed without it needing to do anything.


On a test server, I ran::

(using world.sql)
mysql&#62; FLUSH TABLE WITH READ LOCK;
mysql&#62; ALTER TABLE City ENGINE=InnoDB;
mysql&#62; CREATE TABLE Citytmp LIKE City;
mysql&#62; ALTER TABLE Citytmp MODIFY ID INT UNSIGNED NOT NULL AUTO_INCREMENT;

# cp /var/lib/mysql/world/Citytmp.frm /var/lib/mysql/world/City.frm

mysql&#62; UNLOCK TABLES;



I then did it on a customers box that had 2^31 rows in Innodb with a primary key of signed int which was the initial problem. it worked great!</description>
		<content:encoded><![CDATA[<p>Hi guys</p>
<p>I tried this though instead changed a signed INT to an unsigned INT. </p>
<p>MySQL uses twos complement for negative ints and knowing that a table doesn’t contain any negative values, it was possible to just tell MySQL to use unsigned ints instead of signed without it needing to do anything.</p>
<p>On a test server, I ran::</p>
<p>(using world.sql)<br />
mysql&gt; FLUSH TABLE WITH READ LOCK;<br />
mysql&gt; ALTER TABLE City ENGINE=InnoDB;<br />
mysql&gt; CREATE TABLE Citytmp LIKE City;<br />
mysql&gt; ALTER TABLE Citytmp MODIFY ID INT UNSIGNED NOT NULL AUTO_INCREMENT;</p>
<p># cp /var/lib/mysql/world/Citytmp.frm /var/lib/mysql/world/City.frm</p>
<p>mysql&gt; UNLOCK TABLES;</p>
<p>I then did it on a customers box that had 2^31 rows in Innodb with a primary key of signed int which was the initial problem. it worked great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Using MMM to ALTER huge tables &#124; MySQL Performance Blog</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-258509</link>
		<dc:creator>Using MMM to ALTER huge tables &#124; MySQL Performance Blog</dc:creator>
		<pubDate>Thu, 27 Mar 2008 20:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-258509</guid>
		<description>[...] months ago, I wrote about a faster way to do certain table modifications online. It works well when all you want is to remove auto_increment or change ENUM values. When it comes [...]</description>
		<content:encoded><![CDATA[<p>[...] months ago, I wrote about a faster way to do certain table modifications online. It works well when all you want is to remove auto_increment or change ENUM values. When it comes [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Blasgen</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-245241</link>
		<dc:creator>Nicholas Blasgen</dc:creator>
		<pubDate>Thu, 21 Feb 2008 08:37:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-245241</guid>
		<description>Now if there was just some way for me to update the COMMENT field of a column without defining everything else and rebuilding the table.

ALTER TABLE accounts ALTER COLUMN cWork SET COMMENT 'Foo';

But the current structure is more like:

ALTER TABLE accounts ALTER COLUMN cWork cWork BIGINT(11) UNSIGNED NOT NULL COMMENT 'Foo';

And changing all that is just silly for something as minor as a comment change.</description>
		<content:encoded><![CDATA[<p>Now if there was just some way for me to update the COMMENT field of a column without defining everything else and rebuilding the table.</p>
<p>ALTER TABLE accounts ALTER COLUMN cWork SET COMMENT &#8216;Foo&#8217;;</p>
<p>But the current structure is more like:</p>
<p>ALTER TABLE accounts ALTER COLUMN cWork cWork BIGINT(11) UNSIGNED NOT NULL COMMENT &#8216;Foo&#8217;;</p>
<p>And changing all that is just silly for something as minor as a comment change.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregert Johnson</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-239031</link>
		<dc:creator>Gregert Johnson</dc:creator>
		<pubDate>Mon, 04 Feb 2008 20:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-239031</guid>
		<description>Re: "15. Travis" - For MyISAM tables, you should see files created in the MySQL data directory with names something like #sqlnnn.frm, #sqlnnn.MYD, #sqlnnn.MYI, which are the temporary files being created to eventually replace your actual table (nnn is a sequence number).  The .MYD file (data file) is written first, and you can monitor the change in its size - it will probably end up being somewhat larger than the original .MYD file.  Next the .MYI file is built, and you can monitor its size as it's written, too.  If there had been no deletes or updates to the original index, then the final size of #sqlnnn.MYI will probably be exactly the same as the original .MYI, so you'll be able to judge how rapidly the rebuild is progressing.</description>
		<content:encoded><![CDATA[<p>Re: &#8220;15. Travis&#8221; - For MyISAM tables, you should see files created in the MySQL data directory with names something like #sqlnnn.frm, #sqlnnn.MYD, #sqlnnn.MYI, which are the temporary files being created to eventually replace your actual table (nnn is a sequence number).  The .MYD file (data file) is written first, and you can monitor the change in its size - it will probably end up being somewhat larger than the original .MYD file.  Next the .MYI file is built, and you can monitor its size as it&#8217;s written, too.  If there had been no deletes or updates to the original index, then the final size of #sqlnnn.MYI will probably be exactly the same as the original .MYI, so you&#8217;ll be able to judge how rapidly the rebuild is progressing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-231345</link>
		<dc:creator>Travis</dc:creator>
		<pubDate>Wed, 16 Jan 2008 18:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-231345</guid>
		<description>Great info here.  I am adding a nullable column to a table as we speak in a production environment.  The table has over 43 million rows.  Does anyone know a way to check the progress of this change - i.e. is it worth waiting or do I stop it and employ this change?  I know it's a little off topic, but help would be appreciated.

Thanks!</description>
		<content:encoded><![CDATA[<p>Great info here.  I am adding a nullable column to a table as we speak in a production environment.  The table has over 43 million rows.  Does anyone know a way to check the progress of this change - i.e. is it worth waiting or do I stop it and employ this change?  I know it&#8217;s a little off topic, but help would be appreciated.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Burton</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-229247</link>
		<dc:creator>Kevin Burton</dc:creator>
		<pubDate>Wed, 09 Jan 2008 20:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-229247</guid>
		<description>Jay.

Don't worry.  It's already fixed in MySQL 7.0...

:-)</description>
		<content:encoded><![CDATA[<p>Jay.</p>
<p>Don&#8217;t worry.  It&#8217;s already fixed in MySQL 7.0&#8230;</p>
<p> <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Pipes</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-229219</link>
		<dc:creator>Jay Pipes</dc:creator>
		<pubDate>Wed, 09 Jan 2008 19:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-229219</guid>
		<description>This is a huge pet peeve of mine... just renaming a column rebuild the entire table.  Totally foobar, IMHO.  Renaming a column should simply modify table metadata, not needing a full table rebuild.</description>
		<content:encoded><![CDATA[<p>This is a huge pet peeve of mine&#8230; just renaming a column rebuild the entire table.  Totally foobar, IMHO.  Renaming a column should simply modify table metadata, not needing a full table rebuild.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pavel</title>
		<link>http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-211518</link>
		<dc:creator>pavel</dc:creator>
		<pubDate>Mon, 03 Dec 2007 22:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/#comment-211518</guid>
		<description>* 56,000,000 not 56,000,00 :)</description>
		<content:encoded><![CDATA[<p>* 56,000,000 not 56,000,00 <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
