home resources search newsjoinmembers: 6963
PHP Flash Java Ruby Windows Linux
Hiveminds | Wed, 2007-09-05 08:10  tags: ,

The locale module looks for the translations for text. The problem is that the SQL is using an inner join so the process is taking 77 ms. It is not cached all the time so it presents a heavy bottleneck on a busy website.

What we did was change the INNER JOIN to a LEFT JOIN and adjusted the functions code a bit. This is on line 195 of the locale module. After the above changes the query time was reduced to 13ms.

SELECT s.lid, t.translation FROM locales_source s INNER JOIN locales_target t ON s.lid = t.lid AND t.locale = 'sv' WHERE s.source = '

<?php

$result 
db_query("SELECT s.lid, t.translation FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.locale = '%s' WHERE s.source = '%s'"$locale,$string);

?>

SELECT s.lid, t.translation FROM locales_source s INNER JOIN locales_target t ON s.lid = t.lid AND t.locale = 'sv' WHERE s.source = '

printer-friendly version

Hiveminds's picture
This article brought to you by the Hiveminds Magazine - Staff. Contact us if you want to post an article or announcement anonymously
 
 
Windows Adobe Flex Content Management Systems Wordpress Adobe Flex Silverlight Wordpress eRuby
 videos
 articles
 blogs
 comments
 downloads
sitemap

Newsletter

Get updates on Hiveminds services, articles and downloads by signing up for the newsletter.

Editor's choice

Some of the better articles, stories and tutorials found at Hiveminds.

Find more

Find more of Hiveminds articles, stories, tutorials and user comments by searching.




Picked links

Hand picked websites and articles from around the web that provide quality reading.

page top