在 Postgres (>10) 上使用多行插入是否有任何性能提升:
insert into tbl (c1, c2) values
(v1, v2)
(v3, v4);
Run Code Online (Sandbox Code Playgroud)
超过:
begin;
insert into tbl (c1, c2) values (v1, v2);
insert into tbl (c1, c2) values (v3, v4);
commit;
Run Code Online (Sandbox Code Playgroud)
我无耻地复制了以下问题的代码片段,但这个问题是不同的,因为它是关于事务多行插入与多单行插入
postgresql ×1