We'll hope MariaDB doesn't trigger T221458 in that situation.
Bug: T222324
Signed-off-by: Scott Bassett <sbassett@deploy1001.eqiad.wmnet>
Signed-off-by: James D. Forrester <jforrester@wikimedia.org>
Change-Id: I06364e9d0bce45bd97b2ec837d1f479feff76699
// 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 was used, as it seems as likely
- // to be harmed as helped in that case.
- if ( !$this->mTagFilter ) {
+ // 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';
}