-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
tccfence log table delete should be optimized #4489
Comments
|
是的这个我也有想,我是觉得两件事可能都需要做,其中delete的优化比较直接。而定时周期这个可能更加见仁见智,后续可以讨论一下 |
压测日志部分展示,
|
发现explain 原delete语句的时候,type=all,虽然有索引,但也是全表扫描(status索引是有可能走的,最好保留)。综合之前聊的,sql方面优化有3个思路
|
自增主键应该是不可取的,cron表达式是个不错的选择,在某一时刻走索引删除。 |
这个定期删除,时间长了会造成表空间碎片问题吧,是否要考虑按日期分区分表滚动删除或者表空间整理 |
Why you need it?
Is your feature request related to a problem? Please describe in details
tcc_fence_log的定时任务对上一天的记录清除时没有limit,数据量大的时候一次过把所有数据删除可能会造成客户端性能急剧下降(explain出来type是all,全表扫描)
How it could be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.
认为这个表的删除应该有limit 分批删除
Other related information
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: