You may want to try disabling the index during the insert:

ALTER TABLE table1 DISABLE KEYS;
insert into table1 select * from table2;
ALTER TABLE table1 ENABLE KEYS;

And see what that does.

See: http://www.mysql.com/doc/en/ALTER_TABLE.html

Regards,
Mike Hillyer
www.vbmysql.com


> -----Original Message-----
> From: Amit Lonkar [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 24, 2003 9:33 PM
> To: [EMAIL PROTECTED]
> Subject: Query Execution Time in mysql
> 
> 
> Hi All,
> 
> I have 2 tables say "table1" and "table2" in the
> database. I am using the following query to copy all
> the data from table2 to table1. 
> 
> insert into table1 select * from table2;
> 
> Table2 has some 10,000 records while table1 has around
> 11,00,000 records. The time reqd. to execute the above
> query is round about 80- 90 secs. 
> 
> The table1 has 7 columns out of which 5 are composite
> primary keys. No other indexing is provided. I have
> also tried to use the "optimize table table1" command
> but to no effect.
> 
> Please let know if any solution is available.
> 
> Thanks
> Amit Lonkar
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?> [EMAIL PROTECTED]
> 
> 

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

Reply via email to