-
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
ddl: Support drop column on composite index #40972
ddl: Support drop column on composite index #40972
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Hi @blacktear23. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Just thinking, is it possible to use multi-schema change to implement this feature? Thus, we can introduce less changes: create table t (a int, b int, index idx(a, b));
-- Query OK, 0 rows affected (0.17 sec)
alter table t drop index idx, drop column a, add index idx_1(b), rename index idx_1 to idx; What we need to change is to lift the restriction for renaming index specifically. |
For current implements I used to write it before, and the design is more friendly for cancelling and rollback. And drop column with composite index may cause create and remove more than 1 index at once. And I am not familiar with multi-schema change logic so I don't know whether it can handle thise logic. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@blacktear23: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #19196
Problem Summary:
For now TiDB can drop column with single column index covered. This PR will let TiDB can drop column with composite index covered. But if the column is covered by cluster index this PR still not support this case.
What is changed and how it works?
On drop column with composite index, the step is like below:
StatePublic
after write reorganization.StateDeleteReorganization
state rename temp composite index to origin name and set those indexes toStatePublic
For tracking the new composite indexes reorg progress, there has 2 fields add in
job.Model
:After introduced those 2 fields, we can reuse the create index reorg code. Just check if all indexes is reorg finished then fall-through to do the rest works. And if we reuse the create index reorg logic we can get the benefit of
TxnMerge
andIngest
support.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.