insert into 和insert into select性能比较

来源:互联网 发布:淘宝运营规划方案 编辑:程序博客网 时间:2024/04/28 02:16

今天没事,测了一下insert into和insert into select的性能,没想到这两个性能差别这么大。


使用insert into table(field, ...)values(value, ...),insert into table(field, ...)values(value, ...),...

情况
数据库查询

 

使用insert into table(field, ...)select(value,...) union all select(value,...) union all select

(value,...) ...情况
数据库查询

我一次插入的数据是:1190条。用insert into所用的时间在510毫秒上下徘徊,而用insert into select所用的时间在16

毫秒上下徘徊。