Skip to content

Commit

Permalink
fixup! perf(db): optimise indices of mail tables
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGGE committed Feb 18, 2024
1 parent becc12f commit 29a83e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/Migration/Version1100Date20210304143008.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
'default' => false
]);
$tagsTable->setPrimaryKey(['id']);
$tagsTable->addIndex(['user_id'], 'mail_msg_tags_usr_id_index');
// Dropped in Version3600Date20240205180726 because mail_msg_tags_usr_id_index is redundant with mail_msg_tags_usr_lbl_idx
// $tagsTable->addIndex(['user_id'], 'mail_msg_tags_usr_id_index');
$tagsTable->addUniqueIndex(
[
'user_id',
Expand Down
4 changes: 3 additions & 1 deletion lib/Migration/Version1130Date20220412111833.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
// Add named indices
$messagesTable->addIndex(['mailbox_id', 'flag_important', 'flag_deleted', 'flag_seen'], 'mail_messages_id_flags');
$messagesTable->addIndex(['mailbox_id', 'flag_deleted', 'flag_flagged'], 'mail_messages_id_flags2');
$messagesTable->addIndex(['mailbox_id'], 'mail_messages_mailbox_id');
// Dropped in Version3600Date20240205180726 because mail_messages_mailbox_id is redundant with mail_messages_mb_id_uid
// $messagesTable->addIndex(['mailbox_id'], 'mail_messages_mailbox_id');

// mail_messages_msgid_idx was added later and may not exist until optional indices are created
$messagesTable->addIndex(
['message_id'],
Expand Down
3 changes: 2 additions & 1 deletion lib/Migration/Version2300Date20221216115727.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
]);
$table->setPrimaryKey(['id'], 'mail_smime_certs_id_idx');
$table->addIndex(['user_id'], 'mail_smime_certs_uid_idx');
$table->addIndex(['id', 'user_id'], 'mail_smime_certs_id_uid_idx');
// Dropped in Version3600Date20240205180726
// $table->addIndex(['id', 'user_id'], 'mail_smime_certs_id_uid_idx');
}

return $schema;
Expand Down

0 comments on commit 29a83e7

Please sign in to comment.