mysql 10w level mysql data insertion
- 2020-05-10 23:02:36
- OfStack
At first I didn't expect that the data of 10w would be inserted for half an hour in 2w. Later an SQL batch insert was improved
-- Before optimizing the code
insert into table(mobile) values (138000000);
insert into table(mobile) values (138000000);
insert into table(mobile) values (138000000);
...
-- optimized
insert into table(mobile) values (138000000), (138000000), (138000000); ...
-- After optimization insert 12w The data include php Do data processing, overhead 6s The left and right sides.