社区版ob开启了sql聚合功能之后,为何update 语句聚合总失败

【 使用环境 】生产环境 or 测试环境
测试
【 OB or 其他组件 】
OB
【 使用版本 】
obce v3.1.3
【问题描述】清晰明确描述问题
select *from gv$sql_audit where ret_code=-5787,返回
UPDATE bmsql_stock SET s_quantity = 16, s_ytd = s_ytd + 2, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 31116;UPDATE bmsql_stock SET s_quantity = 50, s_ytd = s_ytd + 10, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 33288;UPDATE bmsql_stock SET s_quantity = 65, s_ytd = s_ytd + 6, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 49928;UPDATE bmsql_stock SET s_quantity = 39, s_ytd = s_ytd + 5, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 56764;UPDATE bmsql_stock SET s_quantity = 45, s_ytd = s_ytd + 4, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 65523;UPDATE bmsql_stock SET s_quantity = 66, s_ytd = s_ytd + 5, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 80860;UPDATE bmsql_stock SET s_quantity = 11, s_ytd = s_ytd + 5, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 82948;UPDATE bmsql_stock SET s_quantity = 64, s_ytd = s_ytd + 1, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 90058;UPDATE bmsql_stock SET s_quantity = 23, s_ytd = s_ytd + 8, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + 0 WHERE s_w_id = 332 AND s_i_id = 99276
【复现路径】问题出现前后相关操作
按照官网“https://www.oceanbase.com/docs/community/observer-cn/V3.1.4/10000000000450312”跑benchmarksql的过程中很容易复现此问题
【问题现象及影响】
update语句聚合失败,不得不重新拆分为单独的sql跑,影响benchmarksql运行效果
【附件】

select *from gv$sql_audit where ret_code=-5787 结果中 IS_BATCHED_MULTI_STMT是否为1,倘若发现 RET_CODE=-5787,以及各自独立的 UPDATE 语句,则表明处理 batch physical plan 失败,除了没有正确配置参数外,还有一个可能是:OceanBase 3.2 之前的版本需要 UPDATE 语句的谓语条件包含全部主键。

rewriteBatchedStatements=true&allowMultiQueries=true

配置文件中jdbc url中上述参数开了吗?开了应该就会合并执行

同样是benchmarksql模型中的insert语句,是能够多条insert聚合成一条sql的,说明参数配置没有问题。另外update 中 where条件能够命中主键的

bmsql_stock表里的(s_w_id,s_i_id )是主键

IS_BATCHED_MULTI_STMT=1