From: Aaron Schulz Date: Tue, 8 Apr 2008 08:46:15 +0000 (+0000) Subject: Force index X-Git-Tag: 1.31.0-rc.0~48541 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=51db7c0ece5efb58d4e7387ab2279425ec157ba3;p=lhc%2Fweb%2Fwiklou.git Force index --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 715d894d9a..d89ffd2c29 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -493,12 +493,20 @@ class LogPager extends ReverseChronologicalPager { # Hack this until live global $wgAllowLogDeletion; $log_id = $wgAllowLogDeletion ? 'log_id' : '0 AS log_id'; + # Don't use the wrong logging index + if( $this->user ) { + $index = array( 'USE INDEX' => array( 'logging' => 'user_time' ) ); + } else if( $this->title || $this->pattern ) { + $index = array( 'USE INDEX' => array( 'logging' => 'page_time' ) ); + } else { + $index = array( 'USE INDEX' => array( 'logging' => 'times' ) ); + } return array( 'tables' => array( 'logging', 'user' ), 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', 'log_title', 'log_params', 'log_comment', $log_id, 'log_deleted', 'log_timestamp', 'user_name' ), 'conds' => $this->mConds, - 'options' => array() + 'options' => $index ); }