From: Domas Mituzas Date: Sat, 12 Nov 2005 20:25:33 +0000 (+0000) Subject: add timestamp key on logging table, in order to avoid stupid filesorting X-Git-Tag: 1.6.0~1187 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=b898d890d9b48ccb5b1af6e7afd24d52d0e28362;p=lhc%2Fweb%2Fwiklou.git add timestamp key on logging table, in order to avoid stupid filesorting --- diff --git a/maintenance/archives/patch-logging-times-index.sql b/maintenance/archives/patch-logging-times-index.sql new file mode 100644 index 0000000000..e66ceec449 --- /dev/null +++ b/maintenance/archives/patch-logging-times-index.sql @@ -0,0 +1,9 @@ +-- +-- patch-logging-times-index.sql +-- +-- Add a very humble index on logging times +-- + +ALTER TABLE /*$wgDBprefix*/logging + ADD INDEX times (log_timestamp); + diff --git a/maintenance/tables.sql b/maintenance/tables.sql index db8f42b7e9..018e7ebf46 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -819,7 +819,8 @@ CREATE TABLE /*$wgDBprefix*/logging ( KEY type_time (log_type, log_timestamp), KEY user_time (log_user, log_timestamp), - KEY page_time (log_namespace, log_title, log_timestamp) + KEY page_time (log_namespace, log_title, log_timestamp), + KEY times (log_timestamp) ) TYPE=InnoDB; diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index ace5b2f535..baadae3913 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -182,6 +182,18 @@ function do_image_name_unique_update() { } } +function do_logging_timestamp_index() { + global $wgDatabase; + if( $wgDatabase->indexExists( 'logging', 'times' ) ) { + echo "...timestamp key on logging already exists.\n"; + } else { + echo "Adding timestamp key on logging table... "; + dbsource( archive("patch-logging-times-index.sql"), $wgDatabase ); + echo "ok\n"; + } +} + + function do_watchlist_update() { global $wgDatabase; if( $wgDatabase->fieldExists( 'watchlist', 'wl_notificationtimestamp' ) ) { @@ -705,6 +717,8 @@ function do_all_updates() { //do_image_index_update(); flush(); + do_logging_timestamp_index(); flush(); + initialiseMessages(); flush(); }