`
echohfut
  • 浏览: 232139 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

database batching insert

 
阅读更多

In DB2,

e.g if you issue below sql statement 100 times,
insert into TableA (id , fields) values (1, 'val1');
insert into TableA (id , fields) values (2, 'val2');
insert into TableA (id , fields) values (3, 'val3');
.........................
insert into TableA (id , fields) values (100, 'val100');
if you set jdbc batch_size to 50, it could be only issue two sql to db instead as below:
insert into TableA (id , fields) values (1, 'val1') , (2, 'val2') ,(3, 'val3') ,(4, 'val4') ,......,(50, 'val50')
insert into TableA (id , fields) values (51, 'val51') , (52, 'val52') ,(53, 'val53') ,(54, 'val54'),...... ,(100, 'val100')
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics