It's a known bug in some versions of mysql (including WMF dbs) that it
won't do a loose index scan when a limit is applied. Given that number
of possible types is still very low, this shouldn't be a problem.
More info: https://bugs.mysql.com/bug.php?id=61517
Bug: T115825
Change-Id: I4c3b885ac05b793088a92e054a38a36b9d07c0d4
}
$limit = $params['limit'];
- $this->addOption( 'LIMIT', $limit + 1 );
+
+ // mysql has issues with limit in loose index T115825
+ if ( $this->getDB()->getType() !== 'mysql' ) {
+ $this->addOption( 'LIMIT', $limit + 1 );
+ }
$result = $this->getResult();
$count = 0;