X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinksprop.php;h=8e89c32e50d0c2798819ed0a2342906f9d54c57e;hb=76d62d7b204b48a0794032d2266ed64455058d13;hp=236fb9e06c6621dc70492ec08178aa0c20d04ebf;hpb=99fefe9af6c35ded8e7c9da7bd099719f7133054;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__ );