mssql insert into 和insert into select性能比较

编程学习 2021-07-05 13:42www.dzhlxh.cn编程入门
今天没事,测了一下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毫秒上下徘徊。

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板