Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/Listener/OptionalIndicesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public function handle(Event $event): void {
['structure_analyzed']
);

$event->addMissingIndex(
'mail_messages',
'mail_msg_mb_del_snt_idx',
['mailbox_id', 'flag_deleted', 'sent_at'],
);

$event->addMissingIndex(
'mail_classifiers',
'mail_class_creat_idx',
Expand Down Expand Up @@ -130,6 +136,12 @@ public function handle(Event $event): void {
['email', 'type', 'message_id'],
false,
);

$event->addMissingIndex(
'mail_recipients',
'mail_recip_local_msg_idx',
['local_message_id'],
);
}

}
3 changes: 3 additions & 0 deletions lib/Migration/Version1120Date20220223094709.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
]);
$recipientsTable->addForeignKeyConstraint($localMessageTable, ['local_message_id'], ['id'], ['onDelete' => 'CASCADE']);

// mail_recip_local_msg_idx was added later and may not exist until optional indices are created
$recipientsTable->addIndex(['local_message_id'], 'mail_recip_local_msg_idx');

$attachmentsTable = $schema->getTable('mail_attachments');
$attachmentsTable->addColumn('local_message_id', Types::INTEGER, [
'notnull' => false,
Expand Down
3 changes: 3 additions & 0 deletions lib/Migration/Version1130Date20220412111833.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$messagesTable->addIndex(['mailbox_id', 'thread_root_id', 'sent_at'], 'mail_msg_thrd_root_snt_idx', [], ['lengths' => [null, 64, null]]);
}

// mail_msg_mb_del_snt_idx was added later and may not exist until optional indices are created
$messagesTable->addIndex(['mailbox_id', 'flag_deleted', 'sent_at'], 'mail_msg_mb_del_snt_idx');

return $schema;
}

Expand Down
Loading