From 7003a7c5e825f391c1a83f8e46cdf332a228d874 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 19 Sep 2013 12:51:16 -0700 Subject: [PATCH] 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 --- includes/logging/LogPager.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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' ); -- 2.20.1