Skip to content
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

Merged
merged 4 commits into from
Dec 18, 2017
Merged

*: Set the batch delete/insert size by session variable #5413

merged 4 commits into from
Dec 18, 2017

Conversation

shenli
Copy link
Member

@shenli shenli commented Dec 15, 2017

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.

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.
@shenli
Copy link
Member Author

shenli commented Dec 15, 2017

/run-all-tests

@@ -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"
Copy link
Member

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 ?

Copy link
Member Author

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.

@zz-jason
Copy link
Member

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 15, 2017
@shenli
Copy link
Member Author

shenli commented Dec 15, 2017

/run-all-tests

@shenli
Copy link
Member Author

shenli commented Dec 16, 2017

/run-all-tests

@shenli
Copy link
Member Author

shenli commented Dec 16, 2017

@tiancaiamao @coocood @winkyao PTAL

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao merged commit 65b2b0d into pingcap:master Dec 18, 2017
@shenli shenli deleted the batch-size branch December 18, 2017 09:44
tiancaiamao pushed a commit that referenced this pull request Dec 18, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants