[MediaWiki-commits] [Gerrit] Use STRAIGHT_JOIN in SpecialWhatlinkshere query - change (mediawiki/core)

2015-07-30 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use STRAIGHT_JOIN in SpecialWhatlinkshere query
..


Use STRAIGHT_JOIN in SpecialWhatlinkshere query

* Also added a type hint to avoid IDE errors in this area

Bug: T106682
Change-Id: I825eedaceb0c0323de85466e48582d72c57b201a
---
M includes/specials/SpecialWhatlinkshere.php
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Jcrespo: Looks good to me, but someone else must approve
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialWhatlinkshere.php 
b/includes/specials/SpecialWhatlinkshere.php
index 5db81d4..a6f92d6 100644
--- a/includes/specials/SpecialWhatlinkshere.php
+++ b/includes/specials/SpecialWhatlinkshere.php
@@ -155,7 +155,7 @@
$conds['pagelinks'][] = 'rd_from is NOT NULL';
}
 
-   $queryFunc = function ( $dbr, $table, $fromCol ) use (
+   $queryFunc = function ( IDatabase $dbr, $table, $fromCol ) use (
$conds, $target, $limit, $useLinkNamespaceDBFields
) {
// Read an extra row as an at-end check
@@ -170,11 +170,12 @@
}
// Inner LIMIT is 2X in case of stale backlinks with 
wrong namespaces
$subQuery = $dbr-selectSqlText(
-   array( $table, 'page', 'redirect' ),
+   array( $table, 'redirect', 'page' ),
array( $fromCol, 'rd_from' ),
$conds[$table],
__CLASS__ . '::showIndirectLinks',
-   array( 'ORDER BY' = $fromCol, 'LIMIT' = 2 * 
$queryLimit ),
+   // Force JOIN order per T106682 to avoid large 
filesorts
+   array( 'ORDER BY' = $fromCol, 'LIMIT' = 2 * 
$queryLimit, 'STRAIGHT_JOIN' ),
array(
'page' = array( 'INNER JOIN', 
$fromCol = page_id ),
'redirect' = array( 'LEFT JOIN', $on )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I825eedaceb0c0323de85466e48582d72c57b201a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Jcrespo jcre...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use STRAIGHT_JOIN in SpecialWhatlinkshere query - change (mediawiki/core)

2015-07-29 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Use STRAIGHT_JOIN in SpecialWhatlinkshere query
..

Use STRAIGHT_JOIN in SpecialWhatlinkshere query

* Also added a type hint to avoid IDE errors in this area

Bug: T106682
Change-Id: I825eedaceb0c0323de85466e48582d72c57b201a
---
M includes/specials/SpecialWhatlinkshere.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/227878/1

diff --git a/includes/specials/SpecialWhatlinkshere.php 
b/includes/specials/SpecialWhatlinkshere.php
index 5db81d4..0df1c34 100644
--- a/includes/specials/SpecialWhatlinkshere.php
+++ b/includes/specials/SpecialWhatlinkshere.php
@@ -155,7 +155,7 @@
$conds['pagelinks'][] = 'rd_from is NOT NULL';
}
 
-   $queryFunc = function ( $dbr, $table, $fromCol ) use (
+   $queryFunc = function ( IDatabase $dbr, $table, $fromCol ) use (
$conds, $target, $limit, $useLinkNamespaceDBFields
) {
// Read an extra row as an at-end check
@@ -174,7 +174,8 @@
array( $fromCol, 'rd_from' ),
$conds[$table],
__CLASS__ . '::showIndirectLinks',
-   array( 'ORDER BY' = $fromCol, 'LIMIT' = 2 * 
$queryLimit ),
+   // Force JOIN order per T106682 to avoid large 
filesorts
+   array( 'ORDER BY' = $fromCol, 'LIMIT' = 2 * 
$queryLimit, 'STRAIGHT_JOIN' ),
array(
'page' = array( 'INNER JOIN', 
$fromCol = page_id ),
'redirect' = array( 'LEFT JOIN', $on )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I825eedaceb0c0323de85466e48582d72c57b201a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

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