我刚刚发现 JDBC 的 addBatch 操作,如果给定 "INSERT INTO mytable (id, name) VALUES (?, ?)" 将创建如下内容:
BEGIN TRANSACTION
INSERT INTO mytable (id, name) VALUES (1, "a");
INSERT INTO mytable (id, name) VALUES (2, "b");
...
END TRANSACTION
与这样的陈述相比:"INSERT INTO mytable (id, name) VALUES (1, "a"), (2, "b"), .. "
,大规模交易会慢多少?I/O 的差异是否重要?