Home > Database > Mysql Tutorial > mysql 10w级别的mysql数据插入_MySQL

mysql 10w级别的mysql数据插入_MySQL

WBOY
Release: 2016-06-01 13:21:17
Original
870 people have browsed it

bitsCN.com 开始没想到,这10w的数据一个号码一个号码的插入半个小时才2w。后来改进一条SQL批量插入

-- 优化代码之前的
insert into table(mobile) values (138000000);
insert into table(mobile) values (138000000);
insert into table(mobile) values (138000000);
……

-- 优化之后的
insert into table(mobile) values (138000000), (138000000), (138000000);……

-- 优化之后插入12w数据包括php做数据处理,开销才 6s 左右。
bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template