Add wl_user_notificationtimestamp index
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 3 Jun 2014 19:20:04 +0000 (15:20 -0400)
committerSpringle <springle@wikimedia.org>
Wed, 4 Jun 2014 06:05:38 +0000 (06:05 +0000)
Bug: 65246
Change-Id: If3e9e855c8a21874ca69c4976af207833dcc53f2

includes/installer/MysqlUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
maintenance/archives/patch-watchlist-user-notificationtimestamp-index.sql [new file with mode: 0644]
maintenance/postgres/tables.sql
maintenance/tables.sql

index c538921..2f77021 100644 (file)
@@ -254,6 +254,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        // 1.24
                        array( 'addField', 'page_props', 'pp_sortkey', 'patch-pp_sortkey.sql' ),
                        array( 'dropField', 'recentchanges', 'rc_cur_time', 'patch-drop-rc_cur_time.sql' ),
+                       array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', 'patch-watchlist-user-notificationtimestamp-index.sql' ),
                );
        }
 
index 8c81080..e8de7de 100644 (file)
@@ -250,6 +250,7 @@ class PostgresUpdater extends DatabaseUpdater {
                        array( 'addPgIndex', 'recentchanges', 'rc_timestamp_bot', '(rc_timestamp) WHERE rc_bot = 0' ),
                        array( 'addPgIndex', 'templatelinks', 'templatelinks_from', '(tl_from)' ),
                        array( 'addPgIndex', 'watchlist', 'wl_user', '(wl_user)' ),
+                       array( 'addPgIndex', 'watchlist', 'wl_user_notificationtimestamp', '(wl_user, wl_notificationtimestamp)' ),
                        array( 'addPgIndex', 'logging', 'logging_user_type_time',
                                '(log_user, log_type, log_timestamp)' ),
                        array( 'addPgIndex', 'logging', 'logging_page_id_time', '(log_page,log_timestamp)' ),
index 7813115..111d654 100644 (file)
@@ -132,6 +132,7 @@ class SqliteUpdater extends DatabaseUpdater {
                        // 1.24
                        array( 'addField', 'page_props', 'pp_sortkey', 'patch-pp_sortkey.sql' ),
                        array( 'dropField', 'recentchanges', 'rc_cur_time', 'patch-drop-rc_cur_time.sql' ),
+                       array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', 'patch-watchlist-user-notificationtimestamp-index.sql' ),
                );
        }
 
diff --git a/maintenance/archives/patch-watchlist-user-notificationtimestamp-index.sql b/maintenance/archives/patch-watchlist-user-notificationtimestamp-index.sql
new file mode 100644 (file)
index 0000000..22ae44f
--- /dev/null
@@ -0,0 +1,4 @@
+--
+-- Creates the wl_user_notificationtimestamp index for the watchlist table
+--
+CREATE INDEX /*i*/wl_user_notificationtimestamp ON /*_*/watchlist (wl_user, wl_notificationtimestamp);
index abbfd3a..be8cbdb 100644 (file)
@@ -448,6 +448,7 @@ CREATE TABLE watchlist (
 );
 CREATE UNIQUE INDEX wl_user_namespace_title ON watchlist (wl_namespace, wl_title, wl_user);
 CREATE INDEX wl_user ON watchlist (wl_user);
+CREATE INDEX wl_user_notificationtimestamp ON watchlist (wl_user, wl_notificationtimestamp);
 
 
 CREATE TABLE interwiki (
index 1b8d618..67696f2 100644 (file)
@@ -1129,6 +1129,7 @@ CREATE TABLE /*_*/watchlist (
 
 CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
 CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
+CREATE INDEX /*i*/wl_user_notificationtimestamp ON /*_*/watchlist (wl_user, wl_notificationtimestamp);
 
 
 --