X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinksprop.php;h=8e89c32e50d0c2798819ed0a2342906f9d54c57e;hp=236fb9e06c6621dc70492ec08178aa0c20d04ebf;hb=f43fa6f4f0e2cb60b8543daad661b48a3e0653a9;hpb=c039c6c6b92362c1893d3b0aa56c3211827dc62e 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__ );