There are two tables:
pos
,
temp_pos
. The first table contains a little over 350 million records, the second about 3 million records. Required effectively to transfer data from one table to another. Interested in here are some moments:
1. What engine for this task is better suited InnoDB or MyISAM still?
2. Do you need to disable keys and enable it after? If it speeds up the process slows down or Vice versa?
Now I do it like this:
Pos ALTER TABLE DISABLE KEYS;
INSERT INTO pos (id, position, url_id, dataset_id) SELECT id, position, url_id, dataset_id from temp_pos;
Pos ALTER TABLE ENABLE KEYS;
Now uses MyISAM and the data migration operation takes on average from 40 minutes to 2.5 hours. I want to do it effectively.
MySQL needs to optimizirovat full copy of Tabiti (insert into temp_pos_temp select * from temp_pos). Further, the insert 3 million should go much faster. - April_Wucker commented on October 3rd 19 at 04:42
And then they say that while loading a table from a text file, use LOAD DATA INFILE works on average 20 times faster than INSERT.
instead of:
- Miracle.Bahringer62 commented on October 3rd 19 at 04:48
Describe the objective. Need to know how this data is further used. I, for example, it is difficult to imagine why 300mln copy from one place to another, which is 100 times less data.
>> Tell me, what do you say about the following method, it will be productive there?
Test, but I think that will not happen. The large costs associated with creating and reading the file (parsing). - April_Wucker commented on October 3rd 19 at 04:51