From: Aaron Schulz Date: Thu, 19 Sep 2013 19:51:16 +0000 (-0700) Subject: Reduce use of FORCE INDEX in LogPager X-Git-Tag: 1.31.0-rc.0~18722 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=7003a7c5e825f391c1a83f8e46cdf332a228d874;p=lhc%2Fweb%2Fwiklou.git Reduce use of FORCE INDEX in LogPager * This currently hurts some change tag queries by orders of mangitude. MySQL/Maria query planning is also a fair bit smarter than it used to be. Lastly, WMF table statistics are better maintained now. Change-Id: I4d0ac7a35c9cec6b47771aae718b44bfc03bdfbe --- diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 3fb7b89e58..f8403ca826 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -253,16 +253,13 @@ class LogPager extends ReverseChronologicalPager { # the choices of available indexes. This mainly # avoids site-breaking filesorts. } elseif ( $this->title || $this->pattern || $this->performer ) { - $index['logging'] = array( 'page_time', 'user_time' ); - if ( count( $this->types ) == 1 ) { - $index['logging'][] = 'log_user_type_time'; - } + $index['logging'] = array( 'page_time', 'user_time', 'log_user_type_time' ); } elseif ( count( $this->types ) == 1 ) { - $index['logging'] = 'type_time'; - } else { - $index['logging'] = 'times'; + $index['logging'] = 'type_time'; // @TODO: sucks for change tags + } + if ( count( $index ) ) { + $options['USE INDEX'] = $index; } - $options['USE INDEX'] = $index; # Don't show duplicate rows when using log_search $joins['log_search'] = array( 'INNER JOIN', 'ls_log_id=log_id' );