At 11:01 AM 9/30/2006, you wrote:
I have a 17,000,000 record table that I'm trying to duplicate in
order to make some changes and improvements, then I'll rename it and
drop the original table. So I need this duplicate to be a live table
in the same database as the original.

I tried the "copy table" function in the Operations section of
phpMyAdmin, but this takes too long and ends up hanging the whole db
and I have to restart mysqld. (It's live right now, so I can't let
this happen.)

Someone suggested mysqlhotcopy, but this does not appear to be able
to create a duplicate table live in the same database. If I'm wrong
about this, could someone give me an example of what the syntax would
be? Also, since it locks the original table during the process, I'm
concerned that it will hang up my site for the duration of the
operation.

Any other ideas?

create table newtable select * from oldtable;


This creates a duplicate table but without the indexes. It should take less than 15 minutes. Now with a single Alter Table add the indexes so the newtable only has to be rebuilt once.

Mike
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to