hanchuanchuan / goInception

一个集审核、执行、备份及生成回滚语句于一身的MySQL运维工具
https://hanchuanchuan.github.io/goInception/
GNU General Public License v3.0
1.6k stars 545 forks source link

当Explain出来是多行结果时,DDL预估影响行数不准确容易导致最终评估不准。 #570

Open stayhungry001 opened 1 year ago

stayhungry001 commented 1 year ago

描述 使用archery SQL上线的SQL检测功能时,当提交的SQL通过explain出来的工具是多行结果时(内含join等语句),会导致只有第一行结果返回了archery,其他结果没有返回。 最终结果不准确。

重现 使用包含inner join的update语法时必现。

环境

参数 可能与问题相关的设置参数

hanchuanchuan commented 1 year ago

参数explain_rule可以控制explain受影响行数的处理方式, 目前支持firstmax. 另外, 你可以通过调用选项real_row_count来控制使用select count方式获取真实行数,但该方式会有一定的性能影响.

stale[bot] commented 1 year ago

由于此问题没有最近的活动,因此已被自动标记为陈旧。如果没有进一步的活动,会作为不活跃issue关闭。感谢你对本项目的贡献。 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.