X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Flogging%2FLogPager.php;h=4ecc368d4e847f63b2039391d33336dcb317c4d4;hb=78c11f067909b6b7424f68ead29075619556a243;hp=32afa37301e3f2d0db875541065564f6eaab090b;hpb=a125219ea18035e973491b7e94090d2091f75e8d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 32afa37301..4ecc368d4e 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -333,7 +333,15 @@ class LogPager extends ReverseChronologicalPager { } } # Don't show duplicate rows when using log_search - $joins['log_search'] = [ 'INNER JOIN', 'ls_log_id=log_id' ]; + $joins['log_search'] = [ 'JOIN', 'ls_log_id=log_id' ]; + + // T221458: MySQL/MariaDB (10.1.37) can sometimes irrationally decide that querying `actor` before + // `logging` and filesorting is somehow better than querying $limit+1 rows from `logging`. + // Tell it not to reorder the query. But not when tag filtering or log_search was used, as it + // seems as likely to be harmed as helped in that case. + if ( !$this->mTagFilter && !array_key_exists( 'ls_field', $this->mConds ) ) { + $options[] = 'STRAIGHT_JOIN'; + } $info = [ 'tables' => $tables,