Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/85097
Change subject: Reduce use of FORCE INDEX in LogPager
......................................................................
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
---
M includes/db/Database.php
M includes/logging/LogPager.php
2 files changed, 6 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/97/85097/1
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 27e6dad..91a819e 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1443,7 +1443,7 @@
public function select( $table, $vars, $conds = '', $fname = __METHOD__,
$options = array(), $join_conds = array() ) {
$sql = $this->selectSQLText( $table, $vars, $conds, $fname,
$options, $join_conds );
-
+var_dump( $sql );
return $this->query( $sql, $fname );
}
diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php
index 3fb7b89..f8403ca 100644
--- a/includes/logging/LogPager.php
+++ b/includes/logging/LogPager.php
@@ -253,16 +253,13 @@
# 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
}
- $options['USE INDEX'] = $index;
+ if ( count( $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'
);
--
To view, visit https://gerrit.wikimedia.org/r/85097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d0ac7a35c9cec6b47771aae718b44bfc03bdfbe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits