-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: disable batch DMLs by default #13081
Conversation
Signed-off-by: Shuaipeng Yu <[email protected]>
Signed-off-by: Shuaipeng Yu <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #13081 +/- ##
===========================================
Coverage 80.2724% 80.2724%
===========================================
Files 469 469
Lines 112153 112153
===========================================
Hits 90028 90028
Misses 15197 15197
Partials 6928 6928 |
statistics/handle/update.go
Outdated
h.mu.Unlock() | ||
}() | ||
for { | ||
sql := fmt.Sprintf("delete from mysql.stats_feedback where table_id = %d and hist_id = %d and is_index = %d", tableID, histID, isIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not directly add limit here? The error handling would be simpler.
And maybe 100000 is too large, what about 10000?
Signed-off-by: Shuaipeng Yu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
statistics/handle/update.go
Outdated
h.mu.ctx.GetSessionVars().BatchDelete = false | ||
h.mu.Unlock() | ||
return errors.Trace(err) | ||
defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer h.mu.Unlock()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, PTAL
Signed-off-by: Shuaipeng Yu <[email protected]>
LGTM |
/run-all-tests |
@jackysp merge failed. |
/run-unit-test |
What problem does this PR solve?
Batching commit a DML statement is useless when TiDB supports larger transaction.
What is changed and how it works?
Disable it by default.
Check List
Tests
Code changes
Side effects
Related changes