Comments on: How to re-index a large database table http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/ Stay curious! Mon, 13 May 2013 05:55:40 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: Larry Siden http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-18675 Larry Siden Mon, 20 Sep 2010 00:58:06 +0000 http://www.xaprb.com/blog/?p=146#comment-18675 That’s a great article. Thanks!

]]>
By: llopht http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-16632 llopht Thu, 02 Jul 2009 17:24:24 +0000 http://www.xaprb.com/blog/?p=146#comment-16632 I have a issue similar to your article. In my table many rows are not inserted in the PK order so a simple update of one field take hours (my table have more than 1M records with a size of 2,1GB).

Just a little question, in your solution you create a new table with a new PK, Ok, but how do you do if this PK is used has external key in others tables ?!

Just another question :) I dont known very well Mysql but how the PK can not be ordered with the auto_increment attribute ?!

Thanks !

Jerome

]]>
By: Xaprb http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1327 Xaprb Thu, 03 Aug 2006 19:48:21 +0000 http://www.xaprb.com/blog/?p=146#comment-1327 The reason the bulk inserts were taking days was probably 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.

]]>
By: Xaprb http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1236 Xaprb Wed, 26 Jul 2006 13:09:34 +0000 http://www.xaprb.com/blog/?p=146#comment-1236 Siri,

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 REPLACE or INSERT... ON DUPLICATE KEY UPDATE instead. Deleting and re-inserting is hard on the server. If you must delete, at least try to use TRUNCATE instead; it has much lower cost. I wrote an article on MySQL’s various statements for inserting and updating data in different ways.

]]>
By: Siri http://www.xaprb.com/blog/2006/06/14/how-to-re-index-a-large-database-table/#comment-1218 Siri Tue, 25 Jul 2006 11:15:28 +0000 http://www.xaprb.com/blog/?p=146#comment-1218 I have a issue which seems to have some relation with your analysis

1)I have a fact table of size 950MB

2)I refresh it daily by droping the indexes and truncating the table and then loading the whole data again

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?

Thanks

Siri

]]>