[MediaWiki-commits] [Gerrit] mediawiki/core[master]: API: Force straight join for prop=linkshere|transcludedin|fi...

2016-09-15 Thread jenkins-bot (Code Review)
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:
  Jcrespo: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  Mobrovac: Looks good to me, but someone else must approve
  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/310552
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: master
Gerrit-Owner: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: API: Force straight join for prop=linkshere|transcludedin|fi...

2016-09-14 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/310552

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/310552/1

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/310552
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a363450b818a049938145d0feb207c9894d2a49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie 

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