java MySQL Connector/J ClientPreparedStatement#executeBatchInternal中“选项设置成本”注释的含义是什么?
Env:mysql连接器java 8.0.19
我注意到,当我使用PreparedStament
执行一些批处理操作时,在com.mysql.cj.jdbc.ClientPreparedStatement#executeBatchInternal
源代码中有一条注释说“选项设置rt-wise的成本”。MySQL Connector/J的源代码片段如下:
if (!this.batchHasPlainStatements && this.rewriteBatchedStatements.getValue()) {
if (((PreparedQuery<?>) this.query).getParseInfo().canRewriteAsMultiValueInsertAtSqlLevel()) {
return executeBatchedInserts(batchTimeout);
}
if (!this.batchHasPlainStatements && this.query.getBatchedArgs() != null
&& this.query.getBatchedArgs().size() > 3 /* cost of option setting rt-wise */) {
return executePreparedBatchAsMultiStatement(batchTimeout);
}
}
因此,我的问题是:
- “期权设定成本”这句话的确切含义是什么李>
- 为什么MySQL Connector/J选择3作为重写批处理语句的底线,为什么不选择4或其他数字李>
谢谢
共 (0) 个答案