Merge "Add rc_name_type_patrolled_timestamp index"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 11 Aug 2016 01:58:49 +0000 (01:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 11 Aug 2016 01:58:49 +0000 (01:58 +0000)
includes/installer/MssqlUpdater.php
includes/installer/MysqlUpdater.php
includes/installer/OracleUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
maintenance/archives/patch-add-rc_name_type_patrolled_timestamp_index.sql [new file with mode: 0644]
maintenance/mssql/tables.sql
maintenance/oracle/archives/patch-add-rc_name_type_patrolled_timestamp_index.sql [new file with mode: 0644]
maintenance/oracle/tables.sql
maintenance/postgres/tables.sql
maintenance/tables.sql

index accc42f..770d3bf 100644 (file)
@@ -87,7 +87,11 @@ class MssqlUpdater extends DatabaseUpdater {
                        [ 'updateSchema', 'recentchanges', 'recentchanges-drop-fks',
                                'patch-recentchanges-drop-fks.sql' ],
                        [ 'updateSchema', 'logging', 'logging-drop-fks', 'patch-logging-drop-fks.sql' ],
-                       [ 'updateSchema', 'archive', 'archive-drop-fks', 'patch-archive-drop-fks.sql' ]
+                       [ 'updateSchema', 'archive', 'archive-drop-fks', 'patch-archive-drop-fks.sql' ],
+
+                       // 1.28
+                       [ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
+                               'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
                ];
        }
 
index d414d90..719b66a 100644 (file)
@@ -283,6 +283,10 @@ class MysqlUpdater extends DatabaseUpdater {
                        [ 'addIndex', 'categorylinks', 'cl_collation_ext',
                                'patch-add-cl_collation_ext_index.sql' ],
                        [ 'doCollationUpdate' ],
+
+                       // 1.28
+                       [ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
+                               'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
                ];
        }
 
index 334256b..8075aac 100644 (file)
@@ -113,6 +113,10 @@ class OracleUpdater extends DatabaseUpdater {
                        [ 'dropTable', 'msg_resource' ],
                        [ 'addField', 'watchlist', 'wl_id', 'patch-watchlist-wl_id.sql' ],
 
+                       // 1.28
+                       [ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
+                               'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
+
                        // KEEP THIS AT THE BOTTOM!!
                        [ 'doRebuildDuplicateFunction' ],
 
index a3b50ac..be94d91 100644 (file)
@@ -433,6 +433,10 @@ class PostgresUpdater extends DatabaseUpdater {
                                'addPgField', 'watchlist', 'wl_id',
                                "INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('watchlist_wl_id_seq')"
                        ],
+
+                       // 1.28
+                       [ 'addPgIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
+                               '( rc_namespace, rc_type, rc_patrolled, rc_timestamp )' ],
                ];
        }
 
index 86dccd7..1c6e6eb 100644 (file)
@@ -152,6 +152,10 @@ class SqliteUpdater extends DatabaseUpdater {
                        [ 'addIndex', 'categorylinks', 'cl_collation_ext',
                                'patch-add-cl_collation_ext_index.sql' ],
                        [ 'doCollationUpdate' ],
+
+                       // 1.28
+                       [ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
+                               'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
                ];
        }
 
diff --git a/maintenance/archives/patch-add-rc_name_type_patrolled_timestamp_index.sql b/maintenance/archives/patch-add-rc_name_type_patrolled_timestamp_index.sql
new file mode 100644 (file)
index 0000000..aa54e75
--- /dev/null
@@ -0,0 +1,2 @@
+-- @since 1.28
+CREATE INDEX /*i*/rc_name_type_patrolled_timestamp ON /*_*/recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp);
index 48b2250..ea087a6 100644 (file)
@@ -861,6 +861,7 @@ CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,
 CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
 CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
 CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
+CREATE INDEX /*i*/rc_name_type_patrolled_timestamp ON /*_*/recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp);
 
 
 CREATE TABLE /*_*/watchlist (
diff --git a/maintenance/oracle/archives/patch-add-rc_name_type_patrolled_timestamp_index.sql b/maintenance/oracle/archives/patch-add-rc_name_type_patrolled_timestamp_index.sql
new file mode 100644 (file)
index 0000000..cd0d396
--- /dev/null
@@ -0,0 +1,4 @@
+define mw_prefix='{$wgDBprefix}';
+
+CREATE INDEX &mw_prefix.recentchanges_i08 ON &mw_prefix.recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp);
+
index 27c3030..d9369c9 100644 (file)
@@ -434,6 +434,7 @@ CREATE INDEX &mw_prefix.recentchanges_i04 ON &mw_prefix.recentchanges (rc_new,rc
 CREATE INDEX &mw_prefix.recentchanges_i05 ON &mw_prefix.recentchanges (rc_ip);
 CREATE INDEX &mw_prefix.recentchanges_i06 ON &mw_prefix.recentchanges (rc_namespace, rc_user_text);
 CREATE INDEX &mw_prefix.recentchanges_i07 ON &mw_prefix.recentchanges (rc_user_text, rc_timestamp);
+CREATE INDEX &mw_prefix.recentchanges_i08 ON &mw_prefix.recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp);
 
 CREATE TABLE &mw_prefix.watchlist (
   wl_id                     NUMBER     NOT NULL,
index 61cb198..95c87c0 100644 (file)
@@ -446,6 +446,7 @@ CREATE INDEX rc_namespace_title ON recentchanges (rc_namespace, rc_title);
 CREATE INDEX rc_cur_id          ON recentchanges (rc_cur_id);
 CREATE INDEX new_name_timestamp ON recentchanges (rc_new, rc_namespace, rc_timestamp);
 CREATE INDEX rc_ip              ON recentchanges (rc_ip);
+CREATE INDEX rc_name_type_patrolled_timestamp ON recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp);
 
 
 CREATE SEQUENCE watchlist_wl_id_seq;
index 9c9bdfb..40506bf 100644 (file)
@@ -1136,6 +1136,7 @@ CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,
 CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
 CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
 CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
+CREATE INDEX /*i*/rc_name_type_patrolled_timestamp ON /*_*/recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp);
 
 
 CREATE TABLE /*_*/watchlist (