<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Learning about MySQL Table Fragmentation</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Galen Sprague</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635335</link>
		<dc:creator>Galen Sprague</dc:creator>
		<pubDate>Fri, 21 Aug 2009 20:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635335</guid>
		<description>So I will have to do the following, please correct me if I am wrong:

1. Add innodb_file_per_table to my.cnf
2. Startup mysql and optimize all tables
3. mysqldump all DBs
4. Stop mysql
5. delete ibdata1 and logfiles
6. Startup mysql and import from mysqldump

This should take care of all fragmentation with innodb tables and this will create a new ibdata1 file on startup

Thanks again for everything! :D</description>
		<content:encoded><![CDATA[<p>So I will have to do the following, please correct me if I am wrong:</p>
<p>1. Add innodb_file_per_table to my.cnf<br />
2. Startup mysql and optimize all tables<br />
3. mysqldump all DBs<br />
4. Stop mysql<br />
5. delete ibdata1 and logfiles<br />
6. Startup mysql and import from mysqldump</p>
<p>This should take care of all fragmentation with innodb tables and this will create a new ibdata1 file on startup</p>
<p>Thanks again for everything! <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635326</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 21 Aug 2009 20:03:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635326</guid>
		<description>Free space in the table went away but I believe your ibdata1 has not shrunk.

innodb_file_per_table is a good way to go to ease space management.</description>
		<content:encoded><![CDATA[<p>Free space in the table went away but I believe your ibdata1 has not shrunk.</p>
<p>innodb_file_per_table is a good way to go to ease space management.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Galen Sprague</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635323</link>
		<dc:creator>Galen Sprague</dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635323</guid>
		<description>@Peter, thank you for all of you insight! ;)

Sorry for the newbie questions, but I have a few more.

This actually just worked. I add the line to mysqld within my.cnf. I then optimized the fragmented table and the free data went away. However, I did not need to recreate the table unless optimize took care of this already? Also is having innodb_file_per_table the better way to go? Or should I disable this once my fragmentation is repaired?

Thanks again!</description>
		<content:encoded><![CDATA[<p>@Peter, thank you for all of you insight! <img src='http://www.mysqlperformanceblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Sorry for the newbie questions, but I have a few more.</p>
<p>This actually just worked. I add the line to mysqld within my.cnf. I then optimized the fragmented table and the free data went away. However, I did not need to recreate the table unless optimize took care of this already? Also is having innodb_file_per_table the better way to go? Or should I disable this once my fragmentation is repaired?</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635307</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:51:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635307</guid>
		<description>Yes. This is the option you configure in my.cnf

Note however you will need to recreate tables to start using it. And you main tablespace  ibdata1 will never shrink - typically you would reload database when you start using innodb_file_per_table.</description>
		<content:encoded><![CDATA[<p>Yes. This is the option you configure in my.cnf</p>
<p>Note however you will need to recreate tables to start using it. And you main tablespace  ibdata1 will never shrink &#8211; typically you would reload database when you start using innodb_file_per_table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Galen Sprague</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635304</link>
		<dc:creator>Galen Sprague</dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635304</guid>
		<description>I am not familiar with innodb_file_per_table. Is this something I can turn on now and start utilizing with currently fragmented innodb tables?</description>
		<content:encoded><![CDATA[<p>I am not familiar with innodb_file_per_table. Is this something I can turn on now and start utilizing with currently fragmented innodb tables?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635301</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635301</guid>
		<description>Galen,

OPTIMIZE TABLE will free disk space if innodb_file_per_table is used. Otherwise it will  normally increase free space in innodb tablespace by having pages being more full as well as make table primary key index less fragmented - so full  table scan and PK ranges will be faster.

For Innodb optimize table does not sort indexes (as it does for MyISAM) so the benefit is less.</description>
		<content:encoded><![CDATA[<p>Galen,</p>
<p>OPTIMIZE TABLE will free disk space if innodb_file_per_table is used. Otherwise it will  normally increase free space in innodb tablespace by having pages being more full as well as make table primary key index less fragmented &#8211; so full  table scan and PK ranges will be faster.</p>
<p>For Innodb optimize table does not sort indexes (as it does for MyISAM) so the benefit is less.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Galen Sprague</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-635300</link>
		<dc:creator>Galen Sprague</dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:38:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-635300</guid>
		<description>I&#039;m I overlooking something here. What is the point of running table optimize on innodb tables if it doesn&#039;t get rid of free data? And how might I go about doing this without changing the table to MyISAM first?</description>
		<content:encoded><![CDATA[<p>I&#8217;m I overlooking something here. What is the point of running table optimize on innodb tables if it doesn&#8217;t get rid of free data? And how might I go about doing this without changing the table to MyISAM first?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-386531</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Wed, 19 Nov 2008 15:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-386531</guid>
		<description>Steven,

It really depends. In some cases when there is prevailing access method which is different from physical row layout it  can make a huge difference.   In other cases one may not know prevailing access or may not have time to run alter table order by regularly.  Running ALTER TABLE ... ORDER BY ...  is often much slower than OPTIMIZE TABLE.</description>
		<content:encoded><![CDATA[<p>Steven,</p>
<p>It really depends. In some cases when there is prevailing access method which is different from physical row layout it  can make a huge difference.   In other cases one may not know prevailing access or may not have time to run alter table order by regularly.  Running ALTER TABLE &#8230; ORDER BY &#8230;  is often much slower than OPTIMIZE TABLE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Roussey</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-385997</link>
		<dc:creator>Steven Roussey</dc:creator>
		<pubDate>Wed, 19 Nov 2008 06:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-385997</guid>
		<description>Forget optimize table -- better to use alter table order by xxx and force an arrangement by columns that you most often query against.</description>
		<content:encoded><![CDATA[<p>Forget optimize table &#8212; better to use alter table order by xxx and force an arrangement by columns that you most often query against.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/comment-page-1/#comment-298267</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 13 May 2008 05:01:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/05/01/learning-about-mysql-table-fragmentation/#comment-298267</guid>
		<description>Peter,

Good catch though it does not have anything to do with table fragmentation. Simply  if you&#039;re querying number of rows in table for Innodb it performs estimation - this estimation requires several random dives in the clustered index, which causes IO for large table sizes.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Good catch though it does not have anything to do with table fragmentation. Simply  if you&#8217;re querying number of rows in table for Innodb it performs estimation &#8211; this estimation requires several random dives in the clustered index, which causes IO for large table sizes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

