I have LAMP server with fast storage and a lot of memory and processor power.
There are 2 tables with same structure, one with 30.000.000 records, other is empty.
I want to copy data from first table to second and use this request:
INSERT INTO table2 SELECT * FROM table1 ;
This request need more then 4 hours to complete. I think this is not normal because mysqldump of entire database finishes less then hour.
Are there any limits to SELECT request? Or I must use other code to optimize performance?
Make sure the schema is as like as the first table, then give the order of values in Insert query. * lowers the performance of the Select query, And NoLock Increase the data availability
like,