jenkins-bot has submitted this change and it was merged.

Change subject: API: Force straight join for 
prop=linkshere|transcludedin|fileusage
......................................................................


API: Force straight join for prop=linkshere|transcludedin|fileusage

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
---
M includes/api/ApiQueryBacklinksprop.php
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiQueryBacklinksprop.php 
b/includes/api/ApiQueryBacklinksprop.php
index 236fb9e..8e89c32 100644
--- a/includes/api/ApiQueryBacklinksprop.php
+++ b/includes/api/ApiQueryBacklinksprop.php
@@ -264,6 +264,12 @@
                        }
                }
 
+               // 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__ );

-- 
To view, visit https://gerrit.wikimedia.org/r/311406
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a363450b818a049938145d0feb207c9894d2a49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.18
Gerrit-Owner: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to