Home > Database > Mysql Tutorial > body text

mssql insert into 和insert into select性能比较

WBOY
Release: 2016-06-07 18:00:05
Original
2039 people have browsed it

今天没事,测了一下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毫秒上下徘徊。

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