Catrope has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/351653 )
Change subject: Use IGNORE INDEX(ls_log_id) instead of FORCE INDEX(ls_field_val)
......................................................................
Use IGNORE INDEX(ls_log_id) instead of FORCE INDEX(ls_field_val)
ls_field_val was renamed to PRIMARY, but this is only partially
complete in WMF production. There is only one other index on the
log_search table, so ignoring that one is equivalent to forcing
the other one.
Bug: T17441
Change-Id: I63182a9f94eabb4cc47414d86b02c82bde1e58b0
---
M includes/logging/LogPager.php
1 file changed, 2 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/53/351653/1
diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php
index ea28ff2..e02b8a6 100644
--- a/includes/logging/LogPager.php
+++ b/includes/logging/LogPager.php
@@ -305,14 +305,13 @@
$options = $basic['options'];
$joins = $basic['join_conds'];
- $index = [];
# Add log_search table if there are conditions on it.
# This filters the results to only include log rows that have
# log_search records with the specified ls_field and ls_value
values.
if ( array_key_exists( 'ls_field', $this->mConds ) ) {
$tables[] = 'log_search';
- $index['log_search'] = 'ls_field_val';
- $index['logging'] = 'PRIMARY';
+ $options['IGNORE INDEX'] = [ 'log_search' =>
'ls_log_id' ];
+ $options['USE INDEX'] = [ 'logging' => 'PRIMARY' ];
if ( !$this->hasEqualsClause( 'ls_field' )
|| !$this->hasEqualsClause( 'ls_value' )
) {
@@ -321,9 +320,6 @@
# no duplicate log rows. Otherwise, we need to
remove the duplicates.
$options[] = 'DISTINCT';
}
- }
- if ( count( $index ) ) {
- $options['USE INDEX'] = $index;
}
# Don't show duplicate rows when using log_search
$joins['log_search'] = [ 'INNER JOIN', 'ls_log_id=log_id' ];
--
To view, visit https://gerrit.wikimedia.org/r/351653
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I63182a9f94eabb4cc47414d86b02c82bde1e58b0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits