Insert into and insert into select performance comparison

I'm fine today. I tested the performance of insert into and insert into select. I didn't expect the performance of these two to be so different.


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

Condition
database query

 

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

(value, ...) ... case
database query

The data I insert at one time is: 1190 pieces. The time used by insert into hovers around 510 milliseconds, while the time used by insert into select is 16

Milliseconds go up and down.

Guess you like

Origin blog.csdn.net/daremeself/article/details/5350222