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

The table has the Composite Primary Key will be very slow while using Dumpling to backup in MySQL #29386

Closed
SE-Bin opened this issue Nov 3, 2021 · 1 comment · Fixed by #29399
Labels
component/dumpling This is related to Dumpling of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@SE-Bin
Copy link

SE-Bin commented Nov 3, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

I found that logical backup is very slow while using Dumping in MySQL.

  1. The huge table has a Composite Primary Key and the first column which isn't the type of integer.
  2. With -r option while using dumpling
  3. Table schema like :
CREATE TABLE `f_sn` (
  `f_id` varchar(31) NOT NULL,
  `version` int(11) NOT NULL,
  `revision` int(11) NOT NULL,
  `h_id` bigint(20) NOT NULL DEFAULT '0',
  `v_type` int(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`f_id`,`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

2. What did you expect to see? (Required)

While meeting the column which is not an integer in the first column in Composite Primary Key just like Mydumper. Don't use the integer column to split chunks.

3. What did you see instead (Required)

Dumpling will use the integer column to split chunks.
Just like :

-- session 1
select * from f_sn where `version` >= 1000 and `version` < 2000 order by f_id,version;
-- session 2
select * from f_sn where `version` >= 2000 and `version` < 3000 order by f_id,version;

4. What is your TiDB version? (Required)

Mysql: 5.7.27
Dumpling : v4.0.10 and v5.2.0

@SE-Bin SE-Bin added the type/bug The issue is confirmed as a bug. label Nov 3, 2021
@lichunzhu lichunzhu added the component/dumpling This is related to Dumpling of TiDB. label Nov 3, 2021
@SE-Bin SE-Bin changed the title The table has the Composite Primary Key will be very slow while using dumpling to backup in MySQL The table has the Composite Primary Key will be very slow while using Dumpling to backup in MySQL Nov 3, 2021
@github-actions
Copy link

github-actions bot commented Nov 4, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/dumpling This is related to Dumpling of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants