X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinksprop.php;h=8e89c32e50d0c2798819ed0a2342906f9d54c57e;hb=d6dcf23a8f22245e311d5582e4f9cd0f302e3738;hp=236fb9e06c6621dc70492ec08178aa0c20d04ebf;hpb=b60578d51bdf8d1722d92487475e70209e6c2b4f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBacklinksprop.php b/includes/api/ApiQueryBacklinksprop.php index 236fb9e06c..8e89c32e50 100644 --- a/includes/api/ApiQueryBacklinksprop.php +++ b/includes/api/ApiQueryBacklinksprop.php @@ -264,6 +264,12 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase { } } + // 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__ );