<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to re-index a large database table</title>
	<link>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/</link>
	<description>Stay curious!</description>
	<pubDate>Sun, 20 Jul 2008 22:43:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1327</link>
		<author>Xaprb</author>
		<pubDate>Thu, 03 Aug 2006 19:48:21 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1327</guid>
		<description>&lt;p&gt;The reason the bulk inserts were taking days was &lt;em&gt;probably&lt;/em&gt; that the rows weren't inserted in primary key order.  It may have gone much faster if they had been.  I'm convinced it's still better to do it a bit at a time though.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>The reason the bulk inserts were taking days was <em>probably</em> that the rows weren&#8217;t inserted in primary key order.  It may have gone much faster if they had been.  I&#8217;m convinced it&#8217;s still better to do it a bit at a time though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1236</link>
		<author>Xaprb</author>
		<pubDate>Wed, 26 Jul 2006 13:09:34 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1236</guid>
		<description>&lt;p&gt;Siri,&lt;/p&gt;

&lt;p&gt;I don't think the update/insert should take a terribly long time on that data size, if you're only doing it once a day, but you may want to use &lt;code&gt;REPLACE&lt;/code&gt; or &lt;code&gt;INSERT... ON DUPLICATE KEY UPDATE&lt;/code&gt; instead.  Deleting and re-inserting is hard on the server.  If you must delete, at least try to use &lt;code&gt;TRUNCATE&lt;/code&gt; instead; it has much lower cost.  I wrote an article on &lt;a href="http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/"&gt;MySQL's various statements for inserting and updating data in different ways&lt;/a&gt;.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Siri,</p>
<p>I don&#8217;t think the update/insert should take a terribly long time on that data size, if you&#8217;re only doing it once a day, but you may want to use <code>REPLACE</code> or <code>INSERT... ON DUPLICATE KEY UPDATE</code> instead.  Deleting and re-inserting is hard on the server.  If you must delete, at least try to use <code>TRUNCATE</code> instead; it has much lower cost.  I wrote an article on <a href="http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/">MySQL&#8217;s various statements for inserting and updating data in different ways</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siri</title>
		<link>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1218</link>
		<author>Siri</author>
		<pubDate>Tue, 25 Jul 2006 11:15:28 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1218</guid>
		<description>&lt;p&gt;I have a issue which seems to have some relation with your analysis&lt;/p&gt;

&lt;p&gt;1)I have a fact table of size 950MB&lt;/p&gt;

&lt;p&gt;2)I refresh it daily by droping the indexes and truncating the table and then loading the whole data again&lt;/p&gt;

&lt;p&gt;Now i need to do the same refresh with out truncating the table.  To be more specific i need to insert/update the required records while keeping the old data in the table itself.  Here i am confused as the table is very huge my update or insert is gonna take very long.  Can you please help me out with any suggestions?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Siri&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I have a issue which seems to have some relation with your analysis</p>
<p>1)I have a fact table of size 950MB</p>
<p>2)I refresh it daily by droping the indexes and truncating the table and then loading the whole data again</p>
<p>Now i need to do the same refresh with out truncating the table.  To be more specific i need to insert/update the required records while keeping the old data in the table itself.  Here i am confused as the table is very huge my update or insert is gonna take very long.  Can you please help me out with any suggestions?</p>
<p>Thanks</p>
<p>Siri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-992</link>
		<author>Xaprb</author>
		<pubDate>Wed, 28 Jun 2006 16:04:10 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-992</guid>
		<description>&lt;p&gt;That is in the neighborhood of the data sizes we had too, so the method we used could work for you.  Please feel free to add more comments as your work proceeds!  I'm curious to know how it goes.  Best wishes.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>That is in the neighborhood of the data sizes we had too, so the method we used could work for you.  Please feel free to add more comments as your work proceeds!  I&#8217;m curious to know how it goes.  Best wishes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Vickers</title>
		<link>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-991</link>
		<author>David Vickers</author>
		<pubDate>Wed, 28 Jun 2006 12:44:57 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-991</guid>
		<description>&lt;p&gt;This sounds very similar to our system. The larger files were up to 10Gig in size, which we've reduced by making the main column smaller. We are now in the re-indexing stages, but will eventually have to reduce the 220Gig files, by removing the older data, deleting it etc. Your idea seems sound. We probably will produce a new table, and then remove the old data to archive and then eventually add the present 90 days into the new log, with all the indexing we can find.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>This sounds very similar to our system. The larger files were up to 10Gig in size, which we&#8217;ve reduced by making the main column smaller. We are now in the re-indexing stages, but will eventually have to reduce the 220Gig files, by removing the older data, deleting it etc. Your idea seems sound. We probably will produce a new table, and then remove the old data to archive and then eventually add the present 90 days into the new log, with all the indexing we can find.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
