-
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
*: Set the batch delete/insert size by session variable #5413
Conversation
We hardcode it to 20k. But if the row size is large. It will still break the transaction size limitation. So we need to provide a way to set it dynamicially.
/run-all-tests |
sessionctx/variable/tidb_vars.go
Outdated
@@ -96,6 +96,10 @@ const ( | |||
// split data into multiple batches and use a single txn for each batch. This will be helpful when deleting large data. | |||
TiDBBatchDelete = "tidb_batch_delete" | |||
|
|||
// tidb_dml_batch_size is used to split the insret/delete data into small batches. It only takes effort when tidb_batch_insert/tidb_batch_delete is on. | |||
// Its default value is 20000. When the row size is large. User could change it to a smaller one to avoid break the transaction size limitation. | |||
TiDBDMLBatchSize = "tidb_dml_batch_size" |
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.
tidb_dml_batch_size
may be confused with tidb_max_chunk_size
, how about tidb_write_batch_size
?
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.
tidb_dml_batch_size is used for DML. tidb_max_chunk_size is used for select. DML includes update/insert/delete. So I think tidb_dml_batch_size
is a proper name.
LGTM |
/run-all-tests |
/run-all-tests |
@tiancaiamao @coocood @winkyao PTAL |
LGTM |
We hardcode it to 20k. But if the row size is large. It will still break the transaction size limitation. So we need to provide a way to set it dynamically.