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

Add a system variable to enable automatic split delete data into batches. #4256

Merged
merged 5 commits into from Aug 21, 2017

Conversation

Projects
None yet
3 participants
@shenli
Member

shenli commented Aug 20, 2017

When @@session.tidb_batch_delete is on, TiDB will automatically split to-be-deleted data into batches and use one transaction for each batch. This is an easy way to bypass the transaction size limitation.

mysql> insert into t select * from t;
Query OK, 327680 rows affected (7.66 sec)

mysql> delete from t;
ERROR 1105 (HY000): transaction is too large
mysql> set @@session.tidb_batch_delete=on;
Query OK, 0 rows affected (0.00 sec)

mysql> delete from t;
Query OK, 655360 rows affected (8.67 sec)

shenli added some commits Aug 15, 2017

@zimulala

This comment has been minimized.

Show comment
Hide comment
@zimulala

zimulala Aug 21, 2017

Member

LGTM

Member

zimulala commented Aug 21, 2017

LGTM

@zimulala zimulala added status/LGT2 and removed status/LGT1 labels Aug 21, 2017

@zimulala zimulala merged commit 31edc09 into master Aug 21, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@zimulala zimulala deleted the shenli/batch-delete branch Aug 21, 2017

dbjoa added a commit to cloud-pi/tidb that referenced this pull request Aug 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment