Drupal 4.6.5: There is a problem with performance while translation is being used. The database query (for instance):
SELECT s.lid, t.translation FROM locales_source s INNER JOIN locales_target t ON s.lid = t.lid WHERE s.source = 'this is purely fictious English text example' AND t.locale = 'pl'
takes (for instance) 100 time units to execute. The problem is: there is no index on 'source' field. After:
ALTER TABLE `locales_source` ADD INDEX `source` ( `source` ( 15 ) );
i.e. creating additional index on (for example) 15 first chars of English string, the database query takes 1 (yes: one!) time unit to execute. The performance improvement is therefore dramatic, especially while many strings to translate are present on the page.
This is a suggestion for developers: please add creation of the abovementioned index to the distribution.
--
mhg
Comments
Very nice tip
I've done it and according to devel it have improved very much drupal's performance. I vote to take this into the core.
Administering: Win 2003 SP1-IIS 6.0-PHP 5.0.3 ISAPI-MySQL 5.0-Drupal 4.6.5
Webmaster: www.pesepe.com-Beta.pesepe.com-gamers.pesepe.com
Seems there is already a patch for it
http://drupal.org/node/42463
Needs a further patch to update.inc though.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba