File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
pkg/statistics/handle/storage Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -182,12 +182,12 @@ func ClearOutdatedHistoryStats(sctx sessionctx.Context) error {
182
182
}
183
183
count := rows [0 ].GetInt64 (0 )
184
184
if count > 0 {
185
- sql = "delete from mysql.stats_meta_history use index (idx_create_time) where create_time <= NOW() - INTERVAL %? SECOND limit 5000 "
185
+ sql = "batch on table_id limit 100 delete from mysql.stats_meta_history use index (idx_create_time) where create_time <= NOW() - INTERVAL %? SECOND"
186
186
_ , err = util .Exec (sctx , sql , variable .HistoricalStatsDuration .Load ().Seconds ())
187
187
if err != nil {
188
188
return err
189
189
}
190
- sql = "delete from mysql.stats_history use index (idx_create_time) where create_time <= NOW() - INTERVAL %? SECOND limit 5000 "
190
+ sql = "batch on table_id limit 100 delete from mysql.stats_history use index (idx_create_time) where create_time <= NOW() - INTERVAL %? SECOND"
191
191
_ , err = util .Exec (sctx , sql , variable .HistoricalStatsDuration .Load ().Seconds ())
192
192
logutil .BgLogger ().Info ("clear outdated historical stats" )
193
193
return err
You can’t perform that action at this time.
0 commit comments