I want to copy all data from one table to another and also want to minimise downtime by reducing locking time during data copy process.
I am trying to do something like this
INSERT INTO temp_table SELECT * FROM old_table ORDER BY id;
But it's taking around 45 mins to copy. How could i batch process this to reduce lock time.