Nikerabbit has uploaded a new change for review.

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

Change subject: Further speed up language cloud query
......................................................................

Further speed up language cloud query

With quotes:
205 rows in set (1.14 sec)

Wihtout quotes:
205 rows in set (3.57 sec)

Change-Id: I6cca51c53cca38e053a3c1723b9b90d8ba0513c8
---
M specials/SpecialSupportedLanguages.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/27/189227/1

diff --git a/specials/SpecialSupportedLanguages.php 
b/specials/SpecialSupportedLanguages.php
index a586d35..cb1449b 100644
--- a/specials/SpecialSupportedLanguages.php
+++ b/specials/SpecialSupportedLanguages.php
@@ -184,9 +184,10 @@
                $fields = array( 'substring_index(rc_title, \'/\', -1) as 
lang', 'count(*) as count' );
                $timestamp = $dbr->timestamp( wfTimeStamp( TS_UNIX ) - 60 * 60 
* 24 * $this->period );
                $conds = array(
-                       'rc_title' . $dbr->buildLike( $dbr->anyString(), '/', 
$dbr->anyString() ),
+                       # Without the quotes rc_timestamp index wont be used 
and this query is much slower
+                       "rc_timestamp > '$timestamp'",
                        'rc_namespace' => $wgTranslateMessageNamespaces,
-                       'rc_timestamp > ' . $timestamp,
+                       'rc_title' . $dbr->buildLike( $dbr->anyString(), '/', 
$dbr->anyString() ),
                );
                $options = array( 'GROUP BY' => 'lang', 'HAVING' => 'count > 
20' );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cca51c53cca38e053a3c1723b9b90d8ba0513c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to