From: Amir Sarabadani Date: Thu, 2 Aug 2018 19:12:07 +0000 (+0200) Subject: Add index on rc_this_oldid X-Git-Tag: 1.34.0-rc.0~4390^2 X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=commitdiff_plain;h=ddd47d280860b7101a85ea73540c318112191526;p=lhc%2Fweb%2Fwiklou.git Add index on rc_this_oldid Approved by TechComm Bug: T139012 Change-Id: I0ccfd26d68a5ceef552ae3aa37a6e345b24ff84e --- diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php index 50c4517939..6ebf95e261 100644 --- a/includes/installer/MssqlUpdater.php +++ b/includes/installer/MssqlUpdater.php @@ -144,6 +144,7 @@ class MssqlUpdater extends DatabaseUpdater { [ 'addIndex', 'protected_titles', 'PRIMARY', 'patch-protected_titles-pk.sql' ], [ 'addIndex', 'page_props', 'PRIMARY', 'patch-page_props-pk.sql' ], [ 'addIndex', 'site_identifiers', 'PRIMARY', 'patch-site_identifiers-pk.sql' ], + [ 'addIndex', 'recentchanges', 'rc_this_oldid', 'patch-recentchanges-rc_this_oldid-index.sql' ], ]; } diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 99d6b35bd9..c5c45f0f66 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -367,6 +367,7 @@ class MysqlUpdater extends DatabaseUpdater { 'patch-protected_titles-fix-pk.sql' ], [ 'renameIndex', 'site_identifiers', 'site_ids_type', 'PRIMARY', false, 'patch-site_identifiers-fix-pk.sql' ], + [ 'addIndex', 'recentchanges', 'rc_this_oldid', 'patch-recentchanges-rc_this_oldid-index.sql' ], ]; } diff --git a/includes/installer/OracleUpdater.php b/includes/installer/OracleUpdater.php index c9ed53f8e7..fbb7696b07 100644 --- a/includes/installer/OracleUpdater.php +++ b/includes/installer/OracleUpdater.php @@ -155,6 +155,7 @@ class OracleUpdater extends DatabaseUpdater { [ 'addField', 'change_tag', 'ct_tag_id', 'patch-change_tag-tag_id.sql' ], [ 'addIndex', 'archive', 'ar_revid_uniq', 'patch-archive-ar_rev_id-unique.sql' ], [ 'populateContentTables' ], + [ 'addIndex', 'recentchanges', 'rc_this_oldid', 'patch-recentchanges-rc_this_oldid-index.sql' ], // KEEP THIS AT THE BOTTOM!! [ 'doRebuildDuplicateFunction' ], diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 932c9412fa..e8663fbbe3 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -590,6 +590,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addIndex', 'interwiki', 'interwiki_pkey', 'patch-interwiki-pk.sql' ], [ 'addIndex', 'protected_titles', 'protected_titles_pkey', 'patch-protected_titles-pk.sql' ], [ 'addIndex', 'site_identifiers', 'site_identifiers_pkey', 'patch-site_identifiers-pk.sql' ], + [ 'addPgIndex', 'recentchanges', 'rc_this_oldid', '(rc_this_oldid)' ], ]; } diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index 80eb84330b..57bf38975d 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -231,6 +231,7 @@ class SqliteUpdater extends DatabaseUpdater { 'patch-protected_titles-fix-pk.sql' ], [ 'renameIndex', 'site_identifiers', 'site_ids_type', 'PRIMARY', false, 'patch-site_identifiers-fix-pk.sql' ], + [ 'addIndex', 'recentchanges', 'rc_this_oldid', 'patch-recentchanges-rc_this_oldid-index.sql' ], ]; } diff --git a/maintenance/archives/patch-recentchanges-rc_this_oldid-index.sql b/maintenance/archives/patch-recentchanges-rc_this_oldid-index.sql new file mode 100644 index 0000000000..364256b9da --- /dev/null +++ b/maintenance/archives/patch-recentchanges-rc_this_oldid-index.sql @@ -0,0 +1,6 @@ +-- Add an index to recentchanges on rc_this_oldid +-- +-- T139012 +-- + +CREATE INDEX /*i*/rc_this_oldid ON /*_*/recentchanges(rc_this_oldid); \ No newline at end of file diff --git a/maintenance/mssql/tables.sql b/maintenance/mssql/tables.sql index f040c1570d..ebbd6e3569 100644 --- a/maintenance/mssql/tables.sql +++ b/maintenance/mssql/tables.sql @@ -1052,6 +1052,7 @@ CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp CREATE INDEX /*i*/rc_ns_actor ON /*_*/recentchanges (rc_namespace, rc_actor); CREATE INDEX /*i*/rc_actor ON /*_*/recentchanges (rc_actor, rc_timestamp); CREATE INDEX /*i*/rc_name_type_patrolled_timestamp ON /*_*/recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp); +CREATE INDEX /*i*/rc_this_oldid ON /*_*/recentchanges (rc_this_oldid); CREATE TABLE /*_*/watchlist ( diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql index b5e423db5f..7497c20bdb 100644 --- a/maintenance/oracle/tables.sql +++ b/maintenance/oracle/tables.sql @@ -721,6 +721,7 @@ CREATE INDEX &mw_prefix.recentchanges_i07 ON &mw_prefix.recentchanges (rc_user_t CREATE INDEX &mw_prefix.rc_ns_actor ON &mw_prefix.recentchanges (rc_namespace, rc_actor); CREATE INDEX &mw_prefix.rc_actor ON &mw_prefix.recentchanges (rc_actor, rc_timestamp); CREATE INDEX &mw_prefix.recentchanges_i08 ON &mw_prefix.recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp); +CREATE INDEX &mw_prefix.recentchanges_i10 ON &mw_prefix.recentchanges (rc_this_oldid); /*$mw$*/ CREATE TRIGGER &mw_prefix.recentchanges_seq_trg BEFORE INSERT ON &mw_prefix.recentchanges FOR EACH ROW WHEN (new.rc_id IS NULL) diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index adf2688d0e..db68248d88 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -588,6 +588,7 @@ 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 INDEX rc_this_oldid ON recentchanges (rc_this_oldid); CREATE SEQUENCE watchlist_wl_id_seq; diff --git a/maintenance/tables.sql b/maintenance/tables.sql index b503bba73c..8cda4f9272 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -1471,6 +1471,8 @@ CREATE INDEX /*i*/rc_actor ON /*_*/recentchanges (rc_actor, rc_timestamp); -- ApiQueryRecentChanges (T140108) CREATE INDEX /*i*/rc_name_type_patrolled_timestamp ON /*_*/recentchanges (rc_namespace, rc_type, rc_patrolled, rc_timestamp); +-- Article.php and friends (T139012) +CREATE INDEX /*i*/rc_this_oldid ON /*_*/recentchanges (rc_this_oldid); CREATE TABLE /*_*/watchlist ( wl_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,