how to break the table into 100,000 chunks?

thanks


________________________________
 From: Claudio Nanni <claudio.na...@gmail.com>
To: Angela liu <yyll2...@yahoo.com> 
Cc: "mysql@lists.mysql.com" <mysql@lists.mysql.com> 
Sent: Thursday, December 1, 2011 2:24 PM
Subject: Re: best way to copy a innodb table
 
Sure you can, and you should.

but in case you also update/delete rows from the first table you have to
set up trigger to log changes.
if you are lucky (only inserts) then its easier.

Cheers

Claudio

2011/12/1 Angela liu <yyll2...@yahoo.com>

> Hi, folks:
>
>
> I have a situation:
>
> A large innodb table t1 with 45 million rows, need to have a new table t2
> exactly the same as t1, to copy the data from t1 to t2, I have the
> following query:
>
> create table t2 like t1;
>
> insert into t2 select * from t1;
>
>
> but the above insert may run long time , that can interface with
> performance, is there a way to chunk the insert into the new table? like
> breaking it down into chunks of 100,000 rows ?
>
>
> Thanks




-- 
Claudio

Reply via email to