Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The table at this point looks like this:
Note that the old unique constraint UNIQUE KEY
folder_id
(folder_id
,msg_uid
,account_id
) on the three columns is confusingly calledfolder_id
. That's what you get when you don't name your constraints explicitly.After merging #870 we are sure that the old index/constraint is not used for retrieving data. So we can drop it, but...
It also powers the foreign key constraint on
folder_id
column, so I'm adding a one column index to power that constraint.It's most probable that the KEY
account_id_folder_id
(account_id
,folder_id
) can be dropped now as well because it's a prefix of UNIQUE KEYix_imapuid_account_id_folder_id_msg_uid_desc
(account_id
,folder_id
,msg_uid
DESC), but again I want to keep PRs focused and I'll investigate and open another PR.Migration
I'll open a separate PR in the downstream with all the steps needed to perform in the downstream.
Based on PR #870
Full chain of PRs as of 2024-09-03
drop-old-imapuid-constraint
➔one-more-force-index
one-more-force-index
➔master