[Bug]: update table mo_catalog.mo_mysql_compatibility_mode too slow
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Branch Name
v1.1.3
Commit ID
95801d84d
Other Environment Information
- Hardware parameters:
- OS type:
- Others:
Actual Behavior
以100qps 获取mo连接并执行一条简单sql select count(*) from t (t表只有一条数据),记录执行时间:
上图左边是commit: 95801d84d 的执行时间,右边是commit: 14c4496c6,执行时间差距巨大,而且左边执行时间会越来越长。
它们在代码上的区别:左边在auth的时候需要执行两条update语句 update mo_catalog.mo_mysql_compatibility_mode set variable_value = '%s' where account_id = %d and variable_name = '%s';,右边不执行。
这是执行时抓取的cpu profile
cpu top:
flame graph:
Expected Behavior
No response
Steps to Reproduce
1. 本地起mo
2. 以100qps的速度获取mo连接,执行一条简单sql
Additional information
No response
ref: https://github.com/matrixorigin/matrixone/pull/15560
@daviszhen PTAL and triage
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
未投入
系统变量调整后,再确认下。
系统变量重构 #16551 完成后,每次登录鉴权不再会更新mo_mysql_compatibility_mode表。
在当前最新的1.2-dev分支(commit: ed9811a75),重新跑上面的测试,执行时间已经正常了: