i18nstrings_get_source() executes a query similar to this one:

SELECT s.*, i.type, i.oid, i.property  FROM {locales_source} s LEFT JOIN {i18n_strings} i ON s.lid = i.lid WHERE s.textgroup = S AND s.location = S

I.e., it filters the {locales_source} table on on the textgroup and location (type:oid:property) fields. However, core locale module doesn't define an index for those fields, which is causing massive slowdowns the larger the {locales_source} table grows. We noticed about 300-400 msec execution time *per query* (there can be many of them during a single request) on a very heavy {locales_source} table with ~45K entries.

CommentFileSizeAuthor
i18n-DRUPAL-6--1.index_.patch2.07 KBsun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero’s picture

Status: Needs review » Fixed

Good idea, and I see you've taken care of all details in your patch.

Thanks a lot.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.