Unverified Commit 022e5b25 authored by Kevin Dutra's avatar Kevin Dutra Committed by Jonathan Hedstrom
Browse files

Issue #3031714 by kevin.dutra: Database row deletions are inefficient

parent 842bf1e6
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ function message_digest_schema() {
      ],
    ],
    'primary key' => ['id'],
    'unique keys' => [
      'mid' => ['mid'],
    ],
    'indexes' => [
      'aggregate' => ['timestamp', 'sent', 'notifier'],
      'sent' => ['receiver', 'notifier'],
@@ -211,3 +214,11 @@ function message_digest_update_8101() {
  $config->save();

}

/**
 * Add unique index to mid field.
 */
function message_digest_update_8102() {
  $schema = \Drupal::database()->schema();
  $schema->addUniqueKey('message_digest', 'mid', ['mid']);
}