-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[错误报告]: 在mapper里,执行长sql或者超长sql查询,项目运行时间一长,就会特别慢,cpu直接拉满 #6699
Comments
有没有更详细的信息?
|
1.该sql返回最多几百行数据,因为是以天为单位去统计数据的,数据目前就几个月的数据。 |
数据库与你的项目在同一台物理机吗? |
不是,数据库用的阿里云数据库 |
那你应该升级mp,升级连接池,升级驱动再试,毕竟根据你的链路来说和mp关系不大 |
我试试换个数据库连接池 |
确认
当前程序版本
3.5.3.2
问题描述
在mapper里,执行长sql或者超长sql查询,项目运行时间一长,就会特别慢,cpu直接拉满
项目刚启动,这个问题没有出现,但项目运行一天之后,该接口就出现问题了。
出现该问题之后,只需要重启项目,接口就正常了,访问速度非常快。
项目里其他接口均不会出现该问题。
把sql单独拿出来到数据库里面执行,只需要20ms-200ms,但是用代码执行,就达到了20s-30s
接口里就一个执行mapper,然后return。
mybatis plus 插件只配置了一个分页插件,没有多租户插件。
尝试解决: 一开始试过将#{},修改为${},但不起作用。
接口内容非常简单
return serviceMapper.historyDataWithDay(page, requestData.getData().getStoreId(), poiIds);
只有这一句。
`public interface BClientOrderStatisticsServiceMapper {
}`
mapper 里的sql 内容:
详细堆栈日志
The text was updated successfully, but these errors were encountered: