Data replication between tables with identical column names in Mysql

We have a main table containing all users for the last 1 year, regardless of whether they have expired or are active users containing 70 million user records.

This table is too slow in performance, so we wanted to recreate this table with better indexing and better distribution of the data type and insert all the records from the main table into this new table in the current state.

The main table is updated / added every minute, because it is very dynamic.

Without skipping any user, I need to insert all the records (70 million) from the main table into a new table.

What is the best way to do this? How long does it take to insert 70 million records asynchronously.

Is data replication available?

Is there any 1, please suggest me the best solution for this, I need a new table up to date faster.

+4
source share
1 answer

Will a simple insert from the selection not solve your problem?

LOCK TABLES `oldtable` WRITE;
INSERT INTO `newtable` SELECT * FROM `oldtable`;
UNLOCK TABLES;
0
source

Source: https://habr.com/ru/post/1599867/


All Articles