简体   繁体   中英

Insert batch statement difference between two queries

Is there any difference between these two queries:

create table tab(value int, ts timestamp) timestamp(ts) 

-- q1:
insert batch 2 into tab values(1, systimestamp()),(2, systimestamp())

-- q2:
insert batch 2 into tab select cast(x as int),systimestamp()  from long_sequence(2)

Should they be equivalent?

In q1 batch 2 has no effect. In q2 batch 2 will delay commit until two insert statements have been seen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM