01tonythomas has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/182421

Change subject: Re-added the index br_mail_timestamp
......................................................................

Re-added the index br_mail_timestamp

The selectRow operation on BounceHandlerActions::handleFailingRecipients()
would need the old index to run efficiently

Change-Id: I4f38c8531e1dae6f239c0cc743ed3fa82c47db10
---
M BounceHandlerHooks.php
M sql/bounce_records.sql
M sql/create_index.sql
D sql/drop_mail_timestamp_index.sql
4 files changed, 4 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler 
refs/changes/21/182421/1

diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php
index 11b4f62..35f8998 100644
--- a/BounceHandlerHooks.php
+++ b/BounceHandlerHooks.php
@@ -85,10 +85,7 @@
        public static function LoadExtensionSchemaUpdates( DatabaseUpdater 
$updater ) {
                $updater->addExtensionTable( 'bounce_records', __DIR__ . 
'/sql/bounce_records.sql', true );
                $updater->modifyExtensionField( 'bounce_records', 'br_user', 
__DIR__ . '/sql/alter_user_column.sql' );
-               $updater->dropExtensionIndex( 'bounce_records', 
'br_mail_timestamp',
-                       __DIR__  . '/sql/drop_mail_timestamp_index.sql' );
-               $updater->addExtensionIndex( 'bounce_records', 'br_timestamp',
-                       __DIR__ . '/sql/create_index.sql' );
+               $updater->addExtensionIndex( 'bounce_records', 
'br_mail_timestamp', __DIR__ .'/sql/create_index.sql' );
 
                return true;
        }
diff --git a/sql/bounce_records.sql b/sql/bounce_records.sql
index d24c2ad..83252e4 100644
--- a/sql/bounce_records.sql
+++ b/sql/bounce_records.sql
@@ -9,4 +9,5 @@
        br_reason       VARCHAR(255)    NOT NULL  -- Failure reasons
 )/*$wgDBTableOptions*/;
 
+CREATE INDEX /*i*/br_mail_timestamp ON /*_*/bounce_records(br_user_email(50), 
br_timestamp);
 CREATE INDEX /*i*/br_timestamp ON /*_*/bounce_records(br_timestamp);
diff --git a/sql/create_index.sql b/sql/create_index.sql
index 759e53e..66af413 100644
--- a/sql/create_index.sql
+++ b/sql/create_index.sql
@@ -3,4 +3,5 @@
 -- Author: Tony Thomas, Legoktm, Jeff Green
 
 
-CREATE INDEX /*i*/br_timestamp ON /*_*/bounce_records(br_timestamp);
+CREATE INDEX /*i*/br_mail_timestamp ON /*_*/bounce_records(br_user_email(50), 
br_timestamp);
+CREATE INDEX /*i*/br_timestamp ON /*_*/bounce_records(br_timestamp);
\ No newline at end of file
diff --git a/sql/drop_mail_timestamp_index.sql 
b/sql/drop_mail_timestamp_index.sql
deleted file mode 100644
index b4fc953..0000000
--- a/sql/drop_mail_timestamp_index.sql
+++ /dev/null
@@ -1,4 +0,0 @@
--- MySQL version of the database schema for removing br_mail_timestamp index 
for the BounceHandler extension.
--- Licence: GNU GPL v2+
-
-ALTER TABLE /*_*/bounce_records DROP INDEX /*i*/br_mail_timestamp;

-- 
To view, visit https://gerrit.wikimedia.org/r/182421
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f38c8531e1dae6f239c0cc743ed3fa82c47db10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BounceHandler
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to