--- /dev/null
+--
+-- patch-logging-times-index.sql
+--
+-- Add a very humble index on logging times
+--
+
+ALTER TABLE /*$wgDBprefix*/logging
+ ADD INDEX times (log_timestamp);
+
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;
}
}
+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' ) ) {
//do_image_index_update(); flush();
+ do_logging_timestamp_index(); flush();
+
initialiseMessages(); flush();
}