MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query plan if it
thinks there will be more matching rows in the linktable than are in page. Use
STRAIGHT_JOIN here to force it to use the intended, fast plan. See T145079 for
details.
Bug: T145079
Change-Id: I1a363450b818a049938145d0feb207c9894d2a49
}
}
+ // MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query
+ // plan if it thinks there will be more matching rows in the linktable
+ // than are in page. Use STRAIGHT_JOIN here to force it to use the
+ // intended, fast plan. See T145079 for details.
+ $this->addOption( 'STRAIGHT_JOIN' );
+
$this->addOption( 'LIMIT', $params['limit'] + 1 );
$res = $this->select( __METHOD__ );